RefreshPolicy function

The RefreshPolicy function causes policy to be applied immediately on the client computer. To apply policy and specify the type of refresh that should occur, you can call the extended function RefreshPolicyEx.

Syntax

USERENVAPI BOOL RefreshPolicy(
  BOOL bMachine
);

Parameters

bMachine

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.

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

By default, policy is reapplied every 90 minutes.

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header userenv.h
Library Userenv.lib
DLL Userenv.dll

See Also

Group Policy Functions

Group Policy Overview

ProcessGroupPolicy