Login-Klasse

The Login object represents a SQL Server login account that has been granted access to the instance of SQL Server through Windows Authentication or SQL Server Authentication.

Vererbungshierarchie

System.Object
  Microsoft.SqlServer.Management.Smo.SmoObjectBase
    Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase
          Microsoft.SqlServer.Management.Smo.Login

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
<PhysicalFacetAttribute> _
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
Public NotInheritable Class Login _
    Inherits ScriptNameObjectBase _
    Implements ISfcSupportsDesignMode, IObjectPermission, ICreatable, IAlterable,  _
    IDroppable, IRenamable, IScriptable, ILoginOptions, IDmfFacet
'Usage
Dim instance As Login
[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
public sealed class Login : ScriptNameObjectBase, 
    ISfcSupportsDesignMode, IObjectPermission, ICreatable, IAlterable, IDroppable, 
    IRenamable, IScriptable, ILoginOptions, IDmfFacet
[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
public ref class Login sealed : public ScriptNameObjectBase, 
    ISfcSupportsDesignMode, IObjectPermission, ICreatable, IAlterable, IDroppable, 
    IRenamable, IScriptable, ILoginOptions, IDmfFacet
[<SealedAttribute>]
[<PhysicalFacetAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
type Login =  
    class 
        inherit ScriptNameObjectBase 
        interface ISfcSupportsDesignMode 
        interface IObjectPermission 
        interface ICreatable 
        interface IAlterable 
        interface IDroppable 
        interface IRenamable 
        interface IScriptable 
        interface ILoginOptions 
        interface IDmfFacet 
    end
public final class Login extends ScriptNameObjectBase implements ISfcSupportsDesignMode, IObjectPermission, ICreatable, IAlterable, IDroppable, IRenamable, IScriptable, ILoginOptions, IDmfFacet

Der Login-Typ macht folgende Elemente verfügbar.

Konstruktoren

  Name Beschreibung
Öffentliche Methode Login() Initializes a new instance of the Login class.
Öffentliche Methode Login(Server, String) Initializes a new instance of the Login class on the specified instance of SQL Server and with the specified name.

Zum Anfang

Eigenschaften

  Name Beschreibung
Öffentliche Eigenschaft AsymmetricKey Gets the asymmetric key associated with the login.
Öffentliche Eigenschaft Certificate Gets the certificate associated with the login.
Öffentliche Eigenschaft CreateDate Gets the date and time when the login account was created.
Öffentliche Eigenschaft Credential Gets the credential associated with the login.
Öffentliche Eigenschaft DateLastModified Gets the date and time when the login account was last modified.
Öffentliche Eigenschaft DefaultDatabase Gets or sets the default database that the login account is assigned to after logging on to the instance of SQL Server.
Öffentliche Eigenschaft DenyWindowsLogin Gets or sets the Boolean property value that specifies whether the login account has been granted or denied the ability to log on to the instance of SQL Server.
Öffentliche Eigenschaft Events Gets the events associated with the login account.
Öffentliche Eigenschaft HasAccess Gets or sets the Boolean property value that specifies whether the SQL Server login account has access to the instance of SQL Server.
Öffentliche Eigenschaft ID Gets the ID value that uniquely identifies the login account.
Öffentliche Eigenschaft IsDisabled Gets or sets the Boolean property value that specifies whether the SQL Server login account is disabled.
Öffentliche Eigenschaft IsLocked Gets the Boolean property value that specifies whether the login account has been locked out of the instance of SQL Server.
Öffentliche Eigenschaft IsPasswordExpired Gets the Boolean property value that specifies whether the password for the SQL Server login account has expired.
Öffentliche Eigenschaft IsSystemObject Gets or sets the Boolean property value that specifies whether the SQL Server login account is a system object.
Öffentliche Eigenschaft Language Gets or sets the language required by the referenced login account for date formats and system messages.
Öffentliche Eigenschaft LanguageAlias Gets the alias name used for the language that is required by the SQL Server login account.
Öffentliche Eigenschaft LoginType Gets or sets the type of SQL Server login account.
Öffentliche Eigenschaft MustChangePassword Gets the Boolean property value that specifies whether the login account password must be changed when the user next logs on to the instance of SQL Server.
Öffentliche Eigenschaft Name Gets or sets the name of the login. (Überschreibt NamedSmoObject.Name.)
Öffentliche Eigenschaft Parent Gets the Server object that is the parent of the Login object.
Öffentliche Eigenschaft PasswordExpirationEnabled Gets the Boolean property value that specifies whether the password for the login account will automatically expire.
Öffentliche Eigenschaft PasswordHashAlgorithm Gets or sets the hash algorithm used for the password.
Öffentliche Eigenschaft PasswordPolicyEnforced Gets the Boolean property value that specifies whether password policy is enforced for this login account.
Öffentliche Eigenschaft Properties Gets a collection of Property objects that represent the object properties. (Geerbt von SqlSmoObject.)
Öffentliche Eigenschaft Sid Gets or sets the security identifier (SID) for the login account.
Öffentliche Eigenschaft State Gets the state of the referenced object. (Geerbt von SmoObjectBase.)
Öffentliche Eigenschaft Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Geerbt von SqlSmoObject.)
Öffentliche Eigenschaft UserData Gets or sets user-defined data associated with the referenced object. (Geerbt von SmoObjectBase.)
Öffentliche Eigenschaft WindowsLoginAccessType Gets the type of Windows logon access.

Zum Anfang

Methoden

  Name Beschreibung
Öffentliche Methode AddCredential Adds a login credential.
Öffentliche Methode AddToRole Adds the login account to a SQL Server role.
Öffentliche Methode Alter Updates any Login object property changes on the login account on the instance of SQL Server.
Öffentliche Methode ChangePassword(String) Changes the password for the login account.
Öffentliche Methode ChangePassword(String, String) Changes the password for the login account.
Öffentliche Methode ChangePassword(String, Boolean, Boolean) Changes the password for the login account.
Öffentliche Methode Create() Creates a login account on the instance of SQL Server as defined by the Login object.
Öffentliche Methode Create(SecureString) Creates a login account on the instance of SQL Server as defined by the Login object.
Öffentliche Methode Create(String) Creates a login account on the instance of SQL Server as defined by the Login object.
Öffentliche Methode Create(SecureString, LoginCreateOptions) Creates a login account on the instance of SQL Server as defined by the Login object.
Öffentliche Methode Create(String, LoginCreateOptions) Creates a login account on the instance of SQL Server as defined by the Login object.
Öffentliche Methode Deny(ObjectPermissionSet, String) Denies the specified set of permissions for the specified grantee on the login account.
Öffentliche Methode Deny(ObjectPermissionSet, array<String[]) Denies the specified set of permissions for the specified grantees on the logon.
Öffentliche Methode Deny(ObjectPermissionSet, String, Boolean) Denies the specified set of permissions for the specified grantee and other users that the grantee granted the specified set of permissions on the logon.
Öffentliche Methode Deny(ObjectPermissionSet, array<String[], Boolean) Denies the specified set of permissions for the specified grantees and other users that the grantee granted the specified set of permissions on the logon.
Öffentliche Methode Disable Disables the login account.
Öffentliche Methode Discover Discovers a list of type Object. (Geerbt von SqlSmoObject.)
Öffentliche Methode Drop Removes the login account from the instance of SQL Server.
Öffentliche Methode DropCredential Drops a login credential.
Öffentliche Methode Enable Enables the login account.
Öffentliche Methode EnumAgentProxyAccounts Enumerates a list of agent proxy accounts in which the login account is participating.
Öffentliche Methode EnumCredentials Returns a string collection of credentials associated with a login.
Öffentliche Methode EnumDatabaseMappings Enumerates a list of login account mappings to databases and database users.
Öffentliche Methode EnumObjectPermissions() Enumerates a list of object permissions for the login account.
Öffentliche Methode EnumObjectPermissions(String) Enumerates a list of object permissions for a specified grantee on the login account.
Öffentliche Methode EnumObjectPermissions(ObjectPermissionSet) Enumerates a list of object permissions for a specified permission on the login account.
Öffentliche Methode EnumObjectPermissions(String, ObjectPermissionSet) Enumerates a list of object permissions for a specified grantee and a specified permission on the login account.
Öffentliche Methode Equals (Geerbt von Object.)
Geschützte Methode FormatSqlVariant Formats an object as SqlVariant type. (Geerbt von SqlSmoObject.)
Geschützte Methode GetContextDB Gets the context database that is associated with this object. (Geerbt von SqlSmoObject.)
Öffentliche Methode GetDatabaseUser Gets the name of the user that the login account is mapped to in a specified database.
Geschützte Methode GetDBName Gets the database name that is associated with the object. (Geerbt von SqlSmoObject.)
Öffentliche Methode GetHashCode (Geerbt von Object.)
Geschützte Methode GetPropValue Gets a property value of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Geschützte Methode GetPropValueOptional Gets a property value of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Geschützte Methode GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Geschützte Methode GetServerObject Gets the server of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Öffentliche Methode GetType (Geerbt von Object.)
Öffentliche Methode Grant(ObjectPermissionSet, String) Grants the specified set of permissions to the specified grantee on the login account.
Öffentliche Methode Grant(ObjectPermissionSet, array<String[]) Grants the specified set of permissions to the specified grantees on the login account.
Öffentliche Methode Grant(ObjectPermissionSet, String, Boolean) Grants access to the specified permission to the grantee and the ability to grant access to other users on the login account.
Öffentliche Methode Grant(ObjectPermissionSet, array<String[], Boolean) Grants access to the specified permission to the grantees and the ability to grant access to other users on the login account.
Öffentliche Methode Grant(ObjectPermissionSet, String, Boolean, String) Grants the specified set of permissions to the grantee and the ability to grant the set of permissions to other users on the login account under an assumed role.
Öffentliche Methode Grant(ObjectPermissionSet, array<String[], Boolean, String) Grants the specified set of permissions to the grantees and the ability to grant the set of permissions to other users on the logon under an assumed role.
Öffentliche Methode Initialize() Initializes the object and forces the properties be loaded. (Geerbt von SqlSmoObject.)
Öffentliche Methode Initialize(Boolean) Initializes the object and forces the properties be loaded. (Geerbt von SqlSmoObject.)
Öffentliche Methode IsMember Returns a Boolean value that specifies whether the login account is a member of a specified role.
Geschützte Methode IsObjectInitialized Verifies whether the object has been initialized. (Geerbt von SqlSmoObject.)
Geschützte Methode IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (Geerbt von SqlSmoObject.)
Öffentliche Methode ListMembers Returns a list of the roles of which the login account is a member.
Öffentliche Methode Refresh Refreshes the login credentials. (Überschreibt ScriptNameObjectBase.Refresh().)
Öffentliche Methode Rename Renames the login account.
Öffentliche Methode Revoke(ObjectPermissionSet, String) Revokes a previously granted set of permissions from a grantee on the login account.
Öffentliche Methode Revoke(ObjectPermissionSet, array<String[]) Revokes a previously granted set of permissions from a list of grantees on the login account.
Öffentliche Methode Revoke(ObjectPermissionSet, String, Boolean, Boolean) Revokes previously granted permissions from a grantee on the login account and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.
Öffentliche Methode Revoke(ObjectPermissionSet, array<String[], Boolean, Boolean) Revokes previously granted permissions from grantees on the login account and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.
Öffentliche Methode Revoke(ObjectPermissionSet, String, Boolean, Boolean, String) Revokes previously granted permissions from a grantee on the login account and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.
Öffentliche Methode Revoke(ObjectPermissionSet, array<String[], Boolean, Boolean, String) Revokes previously granted permissions from grantees on the login account and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.
Öffentliche Methode Script() Generates a Transact-SQL script that can be used to re-create the login account.
Öffentliche Methode Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the login account as specified by the script options.
Geschützte Methode SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (Geerbt von SqlSmoObject.)
Öffentliche Methode ToString Returns a String that represents the referenced object. (Geerbt von SqlSmoObject.)
Öffentliche Methode Validate Validates the state of an object. (Geerbt von SmoObjectBase.)

Zum Anfang

Ereignisse

  Name Beschreibung
Öffentliches Ereignis PropertyChanged Represents the event that occurs when a property is changed. (Geerbt von SqlSmoObject.)
Öffentliches Ereignis PropertyMetadataChanged Represents the event that occurs when property metadata changes. (Geerbt von SqlSmoObject.)

Zum Anfang

Explizite Schnittstellenimplementierungen

  Name Beschreibung
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.Discover Discovers any dependencies. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.GetDomainRoot Returns the root of the domain. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.GetParent Gets the parent of this object. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.GetPropertyType Gets the type of the specified property. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.GetPropertyValue Gets the value of the specified property. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode IAlienObject.SetPropertyValue Sets the property value. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Methode ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate Eigenschaft ISfcSupportsDesignMode.IsDesignMode Gets a Boolean value that indicates whether the object supports design mode. Nur für Informationszwecke identifiziert. Nicht unterstützt. Zukünftige Kompatibilität wird nicht sichergestellt.

Zum Anfang

Hinweise

To get Login object properties, users can be a member of the public fixed server role.

To set Login object properties, users must have ALTER ANY LOGIN permissions on the server or be a member of the sysadmin fixed server role.

To create or drop a login, users must have ALTER ANY LOGIN permissions on the server or be a member of the sysadmin fixed server role.

To grant, deny, or revoke permission on the login to other users, users must have CONTROL permissions on the logon or be a member of the sysadmin or securityadmin fixed server roles.

To set the password on a login without providing an old password, users must be a member of the sysadmin fixed server role.

Thread Safety

Alle öffentlichen, statischen Elemente dieses Typs (Shared in Microsoft Visual Basic) sind für Vorgänge mit mehreren Threads sicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Beispiele

Verwalten von Benutzern, Rollen und Anmeldungen

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.

Siehe auch

Verweis

Microsoft.SqlServer.Management.Smo-Namespace

Andere Ressourcen

Prinzipale (Datenbankmodul)

CREATE LOGIN (Transact-SQL)