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
targetDomain
Type: Microsoft.GroupPolicy.GPDomainA GPDomain object that holds the destination domain.
newDisplayName
Type: System.StringThe display name of the destination GPO. This name cannot already exist in the domain.
copyAcl
Type: System.Booleantrue to copy the Access Control list (ACL) of the source GPO to the destination GPO; otherwise false.
migrationTable
Type: Microsoft.GroupPolicy.GPMigrationTableA GPMigrationTable object that holds the migration table. Specify null to copy without using a migration table.
statusMessages
Type: Microsoft.GroupPolicy.GPStatusMessageCollectionWhen this method returns, contains a GPStatusMessageCollection that holds status for the operation.
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