Import-CMSecurityRole

Import a security role from an XML file.

Syntax

Import-CMSecurityRole
      [-NewRoleName <String>]
      -Overwrite <Boolean>
      -XmlFileName <String>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Use this cmdlet to import a security role from an XML file. The XML was previously exported from Configuration Manager. You can use this export/import process to backup custom security roles, or copy them between separate hierarchies.

For example, you develop a custom security role in a lab environment. Export this new role from the lab hierarchy, and then import it into the production hierarchy.

For more information on security roles and permissions, see Fundamentals of role-based administration in Configuration Manager.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Import a security role

This command imports a security role into Configuration Manager from the XML export file named RemoteAdminSecurity.xml. The command specifies that the security role that you import overwrites an existing security role with the same name.

Import-CMSecurityRole -XmlFileName "RemoteAdminSecurity.xml" -Overwrite $True

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-NewRoleName

Specify the name for the new security role. If you specify -Overwrite $false, this value overrides the RoleName property in the XML file.

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

-Overwrite

Set this parameter to $true to overwrite an existing security role with the same name.

Type:Boolean
Aliases:OverwrittenExisted
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

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

-XmlFileName

Specify the path of the XML file to import the security role. It can be a local or network path. Include the .xml file extension.

Type:String
Aliases:FileName, FilePath, ImportFilePath, Path, RolesXml
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object