Copy-CMSecurityRole

Creates a custom security role.

Syntax

Copy-CMSecurityRole
    [-Confirm]
    [-Description <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    -InputObject <IResultObject>
    -Name <String>
    [-WhatIf]
    [<CommonParameters>]
Copy-CMSecurityRole [-Confirm] [-Description ] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -Name  -SourceRoleId  [-WhatIf] []
Copy-CMSecurityRole [-Confirm] [-Description ] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -Name  -SourceRoleName  [-WhatIf] []

Description

The Copy-CMSecurityRole cmdlet creates a new security role by using an existing security role as a template. Microsoft System Center 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.

Examples

Example 1: Copy a security role by using an ID

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

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

Example 2: Copy a security role by using a name

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

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

Example 3: Copy a security role

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

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.

Required Parameters

-InputObject

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

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

Specifies a name for the new security scope.

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

Specifies the ID of a security role.

Type:String
Aliases:CopiedFromId
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceRoleName

Specifies the name of a security role.

Type:String
Required:True
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
Required:False
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False