Set-CMSecurityRole

Set-CMSecurityRole

Changes configuration settings of a security role.

Syntax

Parameter Set: SetById
Set-CMSecurityRole -Id <String[]> [-Description <String> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByName
Set-CMSecurityRole -Name <String[]> [-Description <String> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByValue
Set-CMSecurityRole -InputObject <IResultObject> [-Description <String> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed 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.

Parameters

-Description<String>

Specifies the description of a security role.

Aliases

RoleDescription

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 CMSecurityRole object. To get a CMSecurityRole 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

-NewName<String>

Specifies a new name for the security role.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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: Change the name of a security role by using an ID

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

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

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

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

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

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

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.

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

Copy-CMSecurityRole

Export-CMSecurityRole

Get-CMSecurityRole

Import-CMSecurityRole

Remove-CMSecurityRole

Remove-CMSecurityRoleFromAdministrativeUser