Looping a Policy

So a question came up on the System Center Central forums, can I loop a policy? The answer is yes and there are some good reasons to do this. In order to ‘loop’ a policy it needs to be triggered from another policy using a ‘trigger policy’. You use the ‘publish policy data’ object to set return data of the policy (so your loop knows when to exit). Here is a quick example of a ‘Tickle Client’ policy. This is a policy that I often times loop in order to speed the rate with which SCCM clients get newly advertised policies.

The policy takes two inputs, computer name and advertisement ID.  I loop the policy until I see the client fully accepting the advertisement.

To setup the return information of the policy right click on the policy and open up its options.

Add a string type return (or whatever type you want your policy to return)

Now in your publish policy data you can actually add return data

 

Now we add some looping logic to our trigger policy based on that return message

And voilà you have a policy loop!

Advertisements
Posted in Workflow

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: