So you have created an application or script that requires a policy evaluation before it can continue, how can you tell that the policy evaluation request has completed? 

Fortunately there are events provided via WMI that can tell you when policy evalution is complete.  Thats how the Policy Spy tool from the SMS 2003 Toolkit events tab works.

To illustrate with wbemtest:

  • On a test client, open wbemtest, connect to the root\ccm\events namespace.
  • choose "Notification Query" button
  • use this query: "SELECT * FROM CCM_PolicyAgent_Event"
  • while the dialog with the query results is running go to the control panel applet
    and refresh policy.
  • wait a few minutes for the query results to come in as the events are generated.

Check here for an example of how to do subscribe to WMI event notifications with VBScript.