RefreshPolicyEx function

The RefreshPolicyEx function causes policy to be applied immediately on the computer. The extended function allows you to specify the type of policy refresh to apply.

Syntax


BOOL RefreshPolicyEx(
  _In_ BOOL  bMachine,
  _In_ DWORD dwOptions
);

Parameters

bMachine [in]

Specifies whether to refresh the computer policy or user policy. If this value is TRUE, the system refreshes the computer policy. If this value is FALSE, the system refreshes the user policy.

dwOptions [in]

Specifies the type of policy refresh to apply. This parameter can be the following value.

RP_FORCE

Reapply all policies even if no policy change was detected.

Note that if there are any client-side extensions that can be applied at boot or logon time, (for example, an application installation extension), the extensions are re-applied at the next boot or logon, even if no policy change is detected.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

If you do not need to specify the dwOptions parameter, you can call the RefreshPolicy function instead.

By default, policy is reapplied every 90 minutes.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Userenv.h

Library

Userenv.lib

DLL

Userenv.dll

See also

Group Policy Overview
Group Policy Functions
ProcessGroupPolicy
RefreshPolicy
ProcessGroupPolicyEx

 

 

Show: