Copy-CMSecurityRole

Copy-CMSecurityRole

Creates a custom security role.

Syntax

Parameter Set: CopyFromId
Copy-CMSecurityRole -Name <String> -SourceRoleId <String> [-Description <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CopyFromName
Copy-CMSecurityRole -Name <String> -SourceRoleName <String> [-Description <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CopyFromValue
Copy-CMSecurityRole -InputObject <IResultObject> -Name <String> [-Description <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Copy-CMSecurityRole cmdlet creates a new security role by using an existing security role as a template. Microsoft System Center 2012 SP1 Configuration Manager provides several built-in security roles. If you require additional security roles, you can create a custom security role by creating a copy of an existing security role, and then modifying the copy.

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

-InputObject<IResultObject>

Specifies a CMSecurityRole object. To obtain 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 a name for the new security scope.

Aliases

RoleName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

true

-SourceRoleId<String>

Specifies the ID of a security role.

Aliases

CopiedFromId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SourceRoleName<String>

Specifies the name of a security role.

Aliases

none

Required?

true

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: Copy a security role by using an ID

This command creates a new security role named SecRole02 by copying the security role that has the ID SMS000CR.

PS C:\> Copy-CMSecurityRole -Name "SecRole02" -SourceRoleId "SMS000CR"

Example 2: Copy a security role by using a name

This command creates a new security role named SecRole02 by copying the security role named Software Update Manager.

PS C:\> Copy-CMSecurityRole -Name "SecRole02" -SourceRoleName "Software Update Manager"

Example 3: Copy a security role

The first command gets the security role named Software Update Manager and stores it in the $Srole variable.

The second command creates a new security role named SecRole02 by copying the object stored in $Srole.

PS C:\> $Srole = Get-CMSecurityRole -Name "Software Update Manager"
PS C:\> Copy-CMSecurityRole -InputObject $Srole -Name "SecRole02"

Export-CMSecurityRole

Get-CMSecurityRole

Import-CMSecurityRole

Remove-CMSecurityRole

Remove-CMSecurityRoleFromAdministrativeUser

Set-CMSecurityRole