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 SetOptions method sets the options for the GPO.
Syntax
HRESULT SetOptions(
[in] DWORD dwOptions,
[in] DWORD dwMask
);
Parameters
[in] dwOptions
Specifies the new option values. This parameter can be one or more of the following options. For more information, see the following Remarks section.
GPO_OPTION_DISABLE_USER
Disable the user portion of the GPO.
GPO_OPTION_DISABLE_MACHINE
Disable the computer portion of the GPO.
[in] dwMask
Specifies the options to change. This parameter can be one or more of the following options. For more information, see the following Remarks section.
GPO_OPTION_DISABLE_USER
Disable the user portion of the GPO.
GPO_OPTION_DISABLE_MACHINE
Disable the computer portion of the GPO.
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
SetOptions(GPO_OPTION_DISABLE_USER, GPO_OPTION_DISABLE_USER)
To enable the user portion and disable the computer portion, call the SetOptions method as follows:
SetOptions(GPO_OPTION_DISABLE_MACHINE, GPO_OPTION_DISABLE_USER | GPO_OPTION_DISABLE_MACHINE)
To retrieve the options for a GPO, you can call the GetOptions method.
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows Vista |
| Minimum supported server | Windows Server 2008 |
| Target Platform | Windows |
| Header | gpedit.h |
| DLL | Gpedit.dll |