Copy-CMConfigurationPolicy

Copies a configuration policy.

Syntax

Copy-CMConfigurationPolicy
    [-InputObject] <IResultObject>
    [-NewName] <String>
    [-PassThru]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Copy-CMConfigurationPolicy
    [-Id] <Int32>
    [-NewName] <String>
    [-PassThru]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Copy-CMConfigurationPolicy
    [-Name] <String>
    [-NewName] <String>
    [-PassThru]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Copy-CMConfigurationPolicy copies a configuration policy. A configuration policy can be a client authentication certificate profile configuration item, a wireless profile configuration item, or others. See the Alias section for additional policy items that you can use this cmdlet to copy.

Note

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

Examples

Example 1: Copy a configuration policy by using the pipeline

PS XYZ:\> Get-CMConfigurationPolicy -Name "TrustedCACert01" -Fast | Copy-CMConfigurationPolicy -NewName "TrustedCACert01_copy"

This command gets the configuration policy object named TrustedCACert01 and uses the pipeline operator to pass the object to Copy-CMConfiguratinPolicy, which creates a copy of the policy and names it TrustedCACert01_copy.

Example 2: Copy a configuration policy by ID

PS XYZ:\> Copy-CMConfigurationPolicy -Id 16777454 -NewName "EmailProfile1_copy"

This command makes a copy of the configuration policy with the ID of 16777454 and names it EmailProfile1_copy.

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

-Id

Specifies the CI_ID of a configuration policy.

Type:Int32
Aliases:CIId, CI_ID
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Gets a configuration policy object. To obtain a configuration policy object, use the Get-CMConfigurationPolicy cmdlet.

Type:IResultObject
Aliases:ConfigurationPolicy
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of a configuration policy.

Type:String
Aliases:LocalizedDisplayName
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NewName

Specifies a name for the copy of the configuration policy.

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

-PassThru

Add this parameter to return an object that represents the item with which you're working. By default, this cmdlet may not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
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

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object