Get-CMUser
Gets a Configuration Manager user.
Syntax
Get-CMUser
[-Name <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Get-CMUser
-CollectionId <String>
[-Name <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Get-CMUser
-CollectionName <String>
[-Name <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Get-CMUser
-InputObject <IResultObject>
[-Name <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Get-CMUser
-ResourceId <Int32>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
The Get-CMUser cmdlet gets a Configuration Manager user object.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Get a user by name
PS XYZ:\> 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 XYZ:\> 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.
Parameters
-CollectionId
Specifies the ID of a user collection.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CollectionName
Specifies the name of a user collection.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of a user.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
-ResourceId
Specifies the resource ID of a user.
Type: | Int32 |
Aliases: | Id, UserId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
IResultObject[]
IResultObject