IGPMDomain2::RestoreStarterGPO method (gpmgmt.h)

Restores the Starter Group Policy object (GPO) from a GPMStarterGPOBackup object. You can restore a Starter GPO only to the domain in which the Starter GPO was originally created. This is because the operation restores the Starter GPO with its original Starter GPO ID and policy settings.

Syntax

HRESULT RestoreStarterGPO(
  [in]            IGPMStarterGPOBackup *pIGPMTmplBackup,
  [in, optional]  VARIANT              *pvarGPMProgress,
  [out, optional] VARIANT              *pvarGPMCancel,
  [out]           IGPMResult           **ppIGPMResult
);

Parameters

[in] pIGPMTmplBackup

Pointer to the GPMStarterGPOBackup object to restore.

[in, optional] pvarGPMProgress

Specifies a pointer to an IGPMAsyncProgress interface that allows the client to receive status notifications about the progress of the restore operation. The caller must create this interface and then pass the interface pointer in this parameter to receive asynchronous notifications. This parameter must be NULL if the client should not receive asynchronous notifications. The method runs asynchronously if this parameter is not NULL, and the method runs synchronously if NULL.

[out, optional] pvarGPMCancel

Receives a pointer to an IGPMAsyncCancel interface that the client can use to cancel the restore operation. This parameter is not returned if pvarGPMProgress is NULL.

[out] ppIGPMResult

Address of a pointer to the IGPMResult interface that represents the result of the restore operation. That interface contains pointers to an IGPMstarterGPO interface and to an IGPMStatusMsgCollection interface.

Return value

C++

Returns S_OK if successful. Returns a failure code if an error occurs.

JScript

Returns a reference to a GPMResult object.

VB

Returns a reference to a GPMResult object.

Remarks

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

You must check the code that is returned by the IGPMResult::OverallStatus method as well as the one returned by this method to determine whether or not the operation succeeded. OverallStatus returns an overall status code for the operation. If no error occurred during the operation, it returns a success code. Otherwise, it returns a failure code.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header gpmgmt.h
DLL Gpmgmt.dll

See also

IGPMDomain2