Get-SqlUser
Gets an SMO User object.
Syntax
Get-SqlUser [-database] <Database> [<CommonParameters>]
Detailed Description
The Get-SqlUser function gets a collection of SMO User objects for the specified SQL Database.
Related Commands
Parameters
Name |
Description |
Required? |
Pipeline Input |
Default Value |
database |
|
true |
true (ByValue) |
|
Input Type
Microsoft.SqlServer.Management.Smo.Database
You can pipe database objects to Get-SqlUser
Return Values
Microsoft.SqlUser.Management.Smo.User
Get-SqlUser returns a Microsoft.SqlServer.Management.Smo.User object.
Notes
Additional properties including all of the objects owned by the user and the effective members of the user are returned. Nested AD/local groups are recursively enumerated and returned in a flat structure.
Examples
EXAMPLE 1
Get-SqlUser $(Get-SqlDatabase "Z002\sql2K8" pubs)
This command gets a collection of SMO User objects for SQL Server Z002\SQL2K8, pubs database.
EXAMPLE 2
Get-SqlDatabase "Z002\sql2K8" | Get-SqlUser
This command gets a collection SMO User objects for all SQL databases on the SQL Server Z002\SQL2K8.