SqlLogins creates SQL Server logins (Windows or SQL authentication).
Use this resource when you need to create SQL Server logins for users, service accounts, or applications that need to connect to the SQL Server instance. It supports both Windows-integrated logins and SQL Server authentication logins.
Source |
|
DSC Resource |
|
Documentation |
-
Target machine must be running Windows Server 2012 or later.
-
Target machine must be running SQL Server Database Engine 2012 or later.
-
When the
LoginTypeofSqlLoginis used, then the login authentication mode must have been set toMixedorNormal. If set toIntegratedand error will be thrown. -
The
LoginMustChangePasswordproperty/parameter is only valid on aSqlLoginwhere theLoginTypeproperty/parameter is set toSqlLogin'. -
The
LoginMustChangePasswordproperty/parameter can not be used to change this setting on a pre-existing SqlLogin. This property/parameter can only be used when creating a newSqlLoginand where subsequent updates will not be applied or, alternatively, when the desired state will not change (for example, whereLoginMustChangePasswordis initially set to$falseand will always be set to$false).
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
DefaultInstanceName |
String |
Default SQL InstanceName |
Default: |
|
Mandatory |
Hashtable[] |
List of SQL logins. |
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
Name |
Key |
String |
The name of the login. |
|
InstanceName |
Key |
String |
The name of the SQL Server instance to be configured. |
|
LoginType |
String |
The type of login to be created. If LoginType is The login types |
|
|
Ensure |
String |
Determines whether the login should be added ( |
|
|
ServerName |
String |
The host name of the SQL Server to be configured. Default value is the current computer name. |
||
LoginCredential |
PSCredential |
Specifies the password as a Only applies to SQL Logins. |
||
LoginMustChangePassword |
Bool |
Specifies if the login is required to have its password change on the next login. Only applies to SQL Logins. This cannot be updated on a pre-existing SQL Login and any attempt to do this will throw an exception. |
|
|
LoginPasswordExpirationEnabled |
Bool |
Specifies if the login password is required to expire in accordance to the operating system security policy. Only applies to SQL Logins. |
|
|
LoginPasswordPolicyEnforced |
Bool |
Specifies if the login password is required to conform to the password policy specified in the system security policy. Only applies to SQL Logins. |
|
|
Disabled |
Bool |
Specifies if the login is disabled. |
|
|
DefaultDatabase |
String |
Specifies the default database name. |
SqlLogins:
Values:
- Name: NT SERVICE\ClusSvc
LoginType: WindowsUser
InstanceName: MSSQLSERVER
- Name: contoso\install
LoginType: WindowsUser
InstanceName: MSSQLSERVER