IGPMStarterGPO::CopyTo method (gpmgmt.h)

The CopyTo method copies the current Starter GPO and returns a pointer to the copy of the Starter GPO. The method copies all the contents of the Starter GPO but creates the new Starter GPO with the default new Starter GPO delegation settings. Copying a system Starter GPO creates a new custom Starter GPO.

Syntax

HRESULT CopyTo(
  [in, optional] VARIANT    *pvarNewDisplayName,
  [in, optional] VARIANT    *pvarGPMProgress,
  [in, optional] VARIANT    *pvarGPMCancel,
  [out]          IGPMResult **ppIGPMResult
);

Parameters

[in, optional] pvarNewDisplayName

Display name to be put on the copied Starter GPO. A display name is assigned if the VARIANT structure does not contain a BSTR, or if pvarNewDisplayName is NULL.

[in, optional] pvarGPMProgress

Specifies a pointer to an IGPMAsyncProgress interface that allows the client to receive status notifications about the progress of the copy operation. This parameter must be NULL if the client does not receive asynchronous notifications.

[in, optional] pvarGPMCancel

Receives a pointer to an IGPMAsyncCancel interface that the client can use to cancel the copy 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 copy operation. That interface contains pointers to an IGPMGPO interface and an IGPMStatusMsgCollection interface.

Return value

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

For more information, see the following Remarks section.

Remarks

Note that you must check the code 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

IGPMStarterGPO