Set-​CM​Security​Role

Changes configuration settings of a security role.

Syntax

Set-CMSecurityRole
   [-Confirm]
   [-Description <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   -Id <String>
   [-NewName <String>]
   [-WhatIf]
   [<CommonParameters>]
Set-CMSecurityRole
   [-Confirm]
   [-Description <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   -InputObject <IResultObject>
   [-NewName <String>]
   [-WhatIf]
   [<CommonParameters>]
Set-CMSecurityRole
   [-Confirm]
   [-Description <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   -Name <String>
   [-NewName <String>]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-CMSecurityRole cmdlet changes configuration settings of a security role. You can use this cmdlet to change the name and description of a security role.

Examples

Example 1: Change the name of a security role by using an ID

PS C:\> Set-CMSecurityRole -Id "CM100003" -NewName "RTOperator02"

This command renames the security role that has the ID CM100003. The command changes the name to RTOperator02.

Example 2: Change the name of a security role by using a name

PS C:\> Set-CMSecurityRole -Name "SRole02" -NewName "RTOperator02"

This command renames the security role named SRole02. The command changes the name to RTOperator02.

Example 3: Change the name of a security role by using an object variable

PS C:\> $Srole = Get-CMSecurityRole -Id "CM100003"
PS C:\> Set-CMSecurityRole -Inputobject $Srole -NewName "RTOperator02"

The first command gets the security role that has the ID CM100003 and stores it in the $Srole variable.

The second command renames the security role for the object stored in $Srole. The command changes the name to RTOperator02.

Required Parameters

-Id

Specifies an array of IDs of security roles.

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

Specifies a CMSecurityRole object. To get a CMSecurityRole object, use the Get-CMSecurityRole cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies an array of names of security roles.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies the description of a security role.

Type:String
Aliases:RoleDescription
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Specifies a new name for the security role.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False