VB Script to Backup / Restore CPS policies

Rating:
Votes: 4 rating(s),  Score: 20/20
23
comments
17350 views
In response to several requests in our forums, Mark Elliott has written a couple of VB scripts that backup and restore policies stored in a Citrix Presentation Server 4.0 or 4.5 farm.
Written by:
Mark Elliott
Publication Date:
December 06, 2007
Tags:
Doc #Id: 5620


In response to several requests in our forums, Mark Elliott has written a couple of VB scripts that backup and restore policies stored in a Citrix Presentation Server 4.0 or 4.5 farm.

The backup script is pretty straightforward. It allows you to parse two (optional) parameters:

  • Logging detail level
  • XML file name the policy information is written to

The restore script has some more parameters, all of which are optional. For example, you can:

  • Specify the logging detail
  • Whether or not to apply the policy filter
  • Whether or not to overwrite a policy if it already exists
  • The name of the XML file that you're restoring (from the backup script)
  • The policy name (if you only want to restore a subset of the policies in the XML file)

Download a ZIP file containing these two scripts here.

Reader Comments
You are the Man!
Thursday, December 06, 2007 11:01:01 AM
Thank You! Thank You! Thank You!  I am about to migrate 3 different farms into one and all 3 of them have a ton of policies.  I was wondering how I was going to automate this because there was no way I was going to do it manualy.  Thank You!
wonderfull script
Friday, December 07, 2007 4:28:06 AM

I was just writing a script my own to accomplish the same.

Cool.

we all were waiting for this :)
Friday, December 07, 2007 7:28:08 AM
We all were waiting for someone writing a script to backup or restore polices. Thank you mark for writing it but more for sharing it with the community!
Policy Examples
Friday, December 07, 2007 9:00:52 PM

Is there a good comprehensive list of policies and how people design them? 

Big Kev
Sunday, December 09, 2007 9:43:15 PM

Guest
Mark, You're the man!!!
100 policies or more to migrate to new Farm....
Monday, December 10, 2007 5:38:48 AM

Excellent will be this is a life saver for us....

For my own interest(question for all those who read this article) how many policies do people have implemented in their environments?

We have 168 mostly printer mapping policies. This is contrary to what CITRIX advise (too many policies will slow down logon process, not something we have experienced I might add) but goes against Brian's claims in this article - http://www.brianmadden.com/content/article/Best-Practices-for-Citrix-Policy-design-for-Presentation-Server-3-or-4

....Yeah, that’s right. You may have 100 or more Citrix policies in your farm.

Before we look at how you should create policies, I want to shoot down a myth about the number of policies you can create in a farm. I’m not sure if this is from some deeply-buried KB article or some news group myth or what, but there’s some kind of industry-wide fear of creating too many policy objects. Most people balk at the idea of 100 policies in a Citrix farm. “That’s too many!” they say, or, “That will make logons too slow.”

“Nonsense!” is my response. I think you need to make as many policies as you need to get the job done, and if that means that you end up with 100 policy objects in one farm, then so be it.......

So how many policies have you implemented in your FARMs?

 Brian

Check printer connection
Wednesday, December 19, 2007 12:54:37 PM