Export (0) Print
Expand All
Expand Minimize

Remove-CMUser

Updated: February 7, 2014

Applies To: System Center 2012 R2 Configuration Manager

Remove-CMUser

Removes Configuration Manager user accounts.

Syntax

Parameter Set: SearchByIdMandatory
Remove-CMUser -Id <String[]> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Remove-CMUser -Name <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Remove-CMUser -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Remove-CMUser cmdlet removes Microsoft System Center 2012 Configuration Manager user accounts. You can specify user accounts to remove by ID or by name, or you can use the Get-CMUser cmdlet to obtain user accounts to remove.

Parameters

-Force

Performs the action without a confirmation message.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String[]>

Specifies an array of IDs for Configuration Manager user accounts.


Aliases

ResourceId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a Configuration Manager user account object. To obtain a Configuration Manager user account object, use the Get-CMUser cmdlet.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a Configuration Manager user account.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Remove a user account by using an ID

This command removes the user account that has the ID 2063597584.


PS C:\> Remove-CMUser -Id "2063597584"

Example 2: Remove a user account by name

This command removes a user account that has the specified name.


PS C:\> Remove-CMUser -Name "FAREAST\001D$ (001D$)"

Example 3: Remove user accounts by using a variable

This example removes user accounts that are part of the collection that has the ID SMS00004. The first command uses the Get-CMUser cmdlet to get the user accounts that belong to the collection with the specified ID, and stores those user accounts in the $CMUsers variable.

The second command removes the user accounts stored in the $CMUsers variable.


PS C:\> $CMUsers = Get-CMUser -CollectionID "SMS00004"
PS C:\> Remove-CMUser -InputObject $CMUsers

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft