Gpo.CopyTo Method (GPDomain, String, Boolean, GPMigrationTable, GPStatusMessageCollection)

 

Copies the Group Policy object (GPO) to a destination GPO and returns status.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

public Gpo CopyTo(
    GPDomain targetDomain,
    string newDisplayName,
    bool copyAcl,
    GPMigrationTable migrationTable,
    out GPStatusMessageCollection statusMessages
)
public:
Gpo^ CopyTo(
    GPDomain^ targetDomain,
    String^ newDisplayName,
    bool copyAcl,
    GPMigrationTable^ migrationTable,
    [OutAttribute] GPStatusMessageCollection^% statusMessages
)
member CopyTo : 
        targetDomain:GPDomain *
        newDisplayName:string *
        copyAcl:bool *
        migrationTable:GPMigrationTable *
        statusMessages:GPStatusMessageCollection byref -> Gpo
Public Function CopyTo (
    targetDomain As GPDomain,
    newDisplayName As String,
    copyAcl As Boolean,
    migrationTable As GPMigrationTable,
    <OutAttribute> ByRef statusMessages As GPStatusMessageCollection
) As Gpo

Parameters

  • newDisplayName
    Type: System.String

    The display name of the destination GPO. This name cannot already exist in the domain.

  • copyAcl
    Type: System.Boolean

    true to copy the Access Control list (ACL) of the source GPO to the destination GPO; otherwise false.

Return Value

Type: Microsoft.GroupPolicy.Gpo

Returns Gpo. The destination GPO.

Exceptions

Exception Condition
ArgumentException

newDisplayName is an empty string (“”).

ArgumentNullException

The targetDomain parameter or the newDisplayName parameter is null.

See Also

CopyTo Overload
Gpo Class
Microsoft.GroupPolicy Namespace

Return to top