GPDomain.RestoreGpo Method (GpoBackup, GPStatusMessageCollection)

 

Restores a Group Policy object (GPO) to the domain from the specified GPO backup.

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

Syntax

public Gpo RestoreGpo(
    GpoBackup gpoBackup,
    out GPStatusMessageCollection statusMessages
)
public:
Gpo^ RestoreGpo(
    GpoBackup^ gpoBackup,
    [OutAttribute] GPStatusMessageCollection^% statusMessages
)
member RestoreGpo : 
        gpoBackup:GpoBackup *
        statusMessages:GPStatusMessageCollection byref -> Gpo
Public Function RestoreGpo (
    gpoBackup As GpoBackup,
    <OutAttribute> ByRef statusMessages As GPStatusMessageCollection
) As Gpo

Parameters

Return Value

Type: Microsoft.GroupPolicy.Gpo

Returns Gpo. The restored GPO.

Exceptions

Exception Condition
ArgumentNullException

gpoBackup is null.

Remarks

You can only restore a GPO to the domain in which the GPO was originally created because the operation restores the GPO with its original GPO GUID, policy settings, access control lists (ACLs), and links to Windows Management Instrumentation (WMI) filters.

The restore operation returns the contents of a specific GPO to the status it had when the backup was performed.

The restore operation does not modify links between the GPO and any SOMs. These links are attributes of their respective SOMs (scope of management).

The restore operation also does not modify WMI filters. However, because the link to a WMI filter is an attribute of the GPO, the restore operation restores the link to the WMI filter.

See Also

RestoreGpo Overload
GPDomain Class
Microsoft.GroupPolicy Namespace

Return to top