Home > Citrix, PowerShell Scripting, Scripting, XenApp > Exporting XenApp policys with powershell.

Exporting XenApp policys with powershell.

I needed to export our XenApp policies, as both a backup and a reference for an upcoming proof of concept involving XenApp 6. As no migration path is available, having the exported policies in a text document I can keep them open side by side while creating the new policies.

The following assumes your have the Xenapp Cmdlets installed and called.

foreach ($policy in get-xapolicy) {get-xapolicyconfiguration $policy.policyname | out-file “$env:temp\$policy.txt”}

if you would prefer xml files:

foreach ($policy in get-xapolicy) {get-xapolicyconfiguration $policy.policyname | export-clixml “$env:temp\$policy.xml”}

The above script dumps the policys in the chosen format to your temp folder. To auto jump to temp add “explorer $Env:temp” to the end of the line. E.G:

foreach ($policy in get-xapolicy) {get-xapolicyconfiguration $policy.policyname | export-clixml “$env:temp\$policy.xml”} explorer $env:temp

  1. No comments yet.
  1. No trackbacks yet.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s