Get-CMUser

Gets a Configuration Manager user.

Syntax

Get-CMUser
   -CollectionId <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-Name <String>]
   [<CommonParameters>]
Get-CMUser -CollectionName  [-DisableWildcardHandling] [-ForceWildcardHandling] [-Name ]
 []
Get-CMUser [-DisableWildcardHandling] [-ForceWildcardHandling] -InputObject  [-Name ]
 []
Get-CMUser [-DisableWildcardHandling] [-ForceWildcardHandling] [-Name ] []
Get-CMUser [-DisableWildcardHandling] [-ForceWildcardHandling] -ResourceId  []

Description

The Get-CMUser cmdlet gets a Microsoft System Center Configuration Manager user object.

Examples

Example 1: Get a user by name

PS C:\> Get-CMUser -CollectionName "All Users" -Name "Contoso\username01"

This command gets the user named username01 from the All Users collection.

Example 2: Pass a collection and get a user from it

PS C:\> Get-CMCollection -Name "All Users" | Get-CMUser -Name "Contoso\testuser01"

This command gets the collection object named All Users and uses the pipeline operator to pass the object to Get-CMUser, which gets the user named testuser01 from the collection object.

Required Parameters

-CollectionId

Specifies the ID of a user collection.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CollectionName

Specifies the name of a user collection.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a collection object. To obtain a collection object, use the Get-CMCollection cmdlet.

Type:IResultObject
Aliases:Collection
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ResourceId

Specifies the resource ID of a user.

Type:Int32
Aliases:Id, UserId
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of a user.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False