Get‑SqlDscLogin - dsccommunity/SqlServerDsc GitHub Wiki
Gets SQL Server logins.
Get-SqlDscLogin [-ServerObject] <Server> [[-Name] <String>] [-Refresh]
[<CommonParameters>]
Retrieves login objects from a SQL Server Database Engine instance. Specify -Name to return a specific login, or omit -Name to return all logins. Use -Refresh to refresh the login collection before retrieval.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$serverObject | Get-SqlDscLogin -Name 'MyLogin'
Get the login named MyLogin.
Specifies the name of the server login to get.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies that the ServerObject logins should be refreshed before trying to get the login object. This is helpful when logins might have been modified outside of the ServerObject, for example through T-SQL. On instances with a large number of logins, consider ensuring the ServerObject is recent enough.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the current server connection object.
Type: Server
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.