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.
USERENVAPI BOOL RefreshPolicyEx( BOOL bMachine, DWORD dwOptions );
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.
Specifies the type of policy refresh to apply. This parameter can be the following value.
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.
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.
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.
|Windows version||Windows Vista Windows Server 2008|