Export (0) Print
Expand All

IGPMGPO::Backup method

Backs up a Group Policy object (GPO) to the specified directory. A backup operation transfers the contents of a GPO from the Active Directory directory service to the file system. The backup includes the policy settings, the GPO ID, and any access control lists (ACLs) that are associated with the GPO. This method is also used for exporting GPOs to the file system.

Syntax


HRESULT Backup(
  [in]             BSTR bstrBackupDir,
  [in]             BSTR bstrComment,
  [in, optional]   VARIANT *pvarGPMProgress,
  [out, optional]  VARIANT *pvarGPMCancel,
  [out]            IGPMResult **ppIGPMResult
);

Parameters

bstrBackupDir [in]

Name of the file system directory in which the GPMBackup object should be stored. The directory must already exist.

bstrComment [in]

Comment to associate with the GPMBackup object.

pvarGPMProgress [in, optional]

Specifies a pointer to an IGPMAsyncProgress interface that allows the client to receive status notifications about the progress of the backup operation. The method runs synchronously if this parameter is NULL. The method runs asynchronously if this parameter is not NULL. This parameter must be NULL if the client should not receive asynchronous notifications.

pvarGPMCancel [out, optional]

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

ppIGPMResult [out]

Address of a pointer to the IGPMResult interface that represents the result of the backup operation. That interface contains pointers to an IGPMBackup 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 GPO that has been backed-up (also called exported) can be restored to the Active Directory by calling the IGPMDomain::RestoreGPO method or imported into another existing GPO using the IGPMGPO::Import method, depending on the required result.

You must check the code that is returned by the IGPMResult::OverallStatus method as well as the one that is returned by this method to determine whether 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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Redistributable

GPMC on Windows Server 2003 or Windows XP with SP1

Header

Gpmgmt.h

IDL

Gpmgmt.idl

DLL

Gpmgmt.dll

IID

IID_IGPMGPO is defined as 58CC4352-1CA3-48E5-9864-1DA4D6E0D60F

See also

IGPMBackup
IGPMDomain
IGPMGPO
IGPMResult
IGPMStatusMsgCollection

 

 

Show:
© 2014 Microsoft