IGroupPolicyObject2::OpenLocalMachineGPOForPrincipal method

The OpenLocalMachineGPOForPrincipal method opens the local GPO for the specified local user or group on this computer and optionally loads the registry information.

Syntax

HRESULT OpenLocalMachineGPOForPrincipal(
  [in] LPOLESTR pszLocalUserOrGroupSID,
  [in] DWORD    dwFlags
);

Parameters

pszLocalUserOrGroupSID [in]

Pointer to a buffer that receives the local user's SID or local group's SID in string format.

dwFlags [in]

Specifies whether or not the registry information should be loaded for the GPO. This parameter can be one of the following values.

GPO_OPEN_LOAD_REGISTRY

Load the registry information.

GPO_OPEN_READ_ONLY

Open the GPO in read-only mode.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in the Platform SDK header file WinError.h.

Remarks

To open the local GPO for a remote computer, you can call the OpenRemoteMachineGPO method.

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Gpedit2.h
DLL
Gpedit.dll
IID
IID_IGroupPolicyObject2 is defined as 7E37D5E7-263D-45CF-842B-96A95C63E46C

See also

Group Policy Overview

Group Policy Interfaces

IGroupPolicyObject2

OpenRemoteMachineGPO