Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The GetAppliedGPOList function retrieves the list of GPOs applied for the specified user or computer.
USERENVAPI DWORD GetAppliedGPOListW(
[in] DWORD dwFlags,
[in] LPCWSTR pMachineName,
[in] PSID pSidUser,
[in] GUID *pGuidExtension,
[out] PGROUP_POLICY_OBJECTW *ppGPOList
);
[in] dwFlags
A value that specifies the policy type. This parameter can be the following value.
Retrieves information about the computer policy.
If this value is not specified, the function retrieves only user policy information.
[in] pMachineName
A pointer to the name of the remote computer. The format of the name is "\\computer_name". If this parameter is NULL, the local computer name is used.
[in] pSidUser
A value that specifies the SID of the user. If pMachineName is not NULL and dwFlags specifies user policy, then pSidUser cannot be NULL.
If pMachineName is NULL and pSidUser is NULL, the user is the currently logged-on user. If pMachineName is NULL and pSidUser is not NULL, the user is represented by pSidUser on the local computer. For more information, see Security Identifiers.
[in] pGuidExtension
A value that specifies the GUID of the extension.
[out] ppGPOList
A pointer that receives the list of GPO structures. For more information, see GROUP_POLICY_OBJECT.
If the function succeeds, the return value is ERROR_SUCCESS. Otherwise, the function returns a system error code. For a complete list of error codes, see System Error Codes or the header file WinError.h.
To free the GPO list when you have finished processing it, call the FreeGPOList function.
Note
The userenv.h header defines GetAppliedGPOList as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | userenv.h |
Library | Userenv.lib |
DLL | Userenv.dll |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today