Export (0) Print
Expand All
Expand Minimize

Remove-CMSecurityRole

Updated: September 1, 2013

Applies To: System Center 2012 Configuration Manager SP1

Remove-CMSecurityRole

Removes custom security roles from Configuration Manager.

Syntax

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

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

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




Detailed Description

The Remove-CMSecurityRole cmdlet removes custom security roles from Microsoft System Center 2012 Configuration Manager. Specify the name or ID of a security role you want to remove or use the Get-CMSecurityRole cmdlet to obtain one.

System Center 2012 Configuration Manager uses security roles, along with security scopes and collections, to define an administrative scope for each administrative user. System Center 2012 Configuration Manager provides several built-in security roles. To create a custom security role, copy an existing security role, and then modifying the copy. You can copy a security role by using the Copy-CMSecurityRole cmdlet.

You can use the Remove-CMSecurityRole cmdlet to remove old, unneeded custom security roles. You cannot remove built-in security roles. Every administrative user must have at least one security role. Before you remove a security role, make sure every user has a role in addition to the one you remove.

Parameters

-Force

Removes a security role without prompting you for confirmation. By default, the cmdlet prompts you for confirmation before it proceeds.


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 of security roles.


Aliases

RoleId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

Specifies a security role object. To obtain a security role object, use the Get-CMSecurityRole cmdlet.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String[]>

Specifies an array of names of security roles.


Aliases

RoleName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

true

-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 security role by using a name

This command removes a security role named MainSecurityRole from System Center 2012 Configuration Manager. The command uses the Force parameter, so it does not prompt you for confirmation.


PS C:\> Remove-CMSecurityRole -Name "MainSecurityRole" -Force

Example 2: Remove security roles by using a variable

This example removes all the security roles with names that end in Role.

The first command uses the Get-CMSecurity cmdlet to get each security role that has a name that ends in Role. It stores them in the $Roles variable.

The second command removes each security role stored in the $Roles variable.


PS C:\> $Roles = Get-CMSecurityRole -Name *Role PS C:\>Remove-CMSecurityRole -SecurityRole $Roles 

Related topics

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