Using CitrixTools.Net CLI Tools to Export XenApp Published Applications and Policies programmatically
Aug
29
Written by:
8/29/2009 4:27 PM
When running a XenApp environment, there is a huge need of getting all sensible datas saved.
Even if you're running a regular DataStore backup, you can't sometimes deal with it when it comes that the database is corrupted.
Why ? Because it is often hard to know when it was corrupted, so you could waste a lot of time in looking for the specific not corrupted backup, specific backup that may not contains an updated configuration.
Scripting all Farm / Servers settings is quite easy but every application publication / policy creation is not.
To deal with this problem, I'm implementing on my customers site a daily Published Applications / Policies export with XenApp Application Export Manager and XenApp Policies Export Manager.
This is also a good way to have a good and efficient Disaster Recovery Plan, because you could start from a basic farm an quickly get all settings to be imported.
With two little .cmd scripts, you can easily use scheduled tasks to achieve this tasks.
The following scripts are, of course, supposing that XenApp App Export Manager and XenApp Policies Export Manager are installed on the server the tasks are running on.
As these scripts are creating the Export and Logs files with a DateStamp, you can then run them easily as scheduled tasks on your environment.
If you want to be able to purge them programmatically the exports / logs on an age basis, then take a look at the following article, as you'll find a script that answers the question !
To Export Published Resources :
---------------------------------------------------------------------------------
@echo off
set custname=My Customer
set farmname=MyFarm
set expfolder=\\MyServer\Exports
set expfilename=%date:~-2%%date:~3,2%%date:~0,2% - %farmname% - Applications %custname%.ctxtools
set logfile=\\MyServer\Exports\Logs\%date:~-2%%date:~3,2%%date:~0,2%-%farmname%-Applications.log
echo Processing Export File : %expfilename%
"%programfiles%\Citrix Tools\XenApp App Export Manager\XaExpMgrCmd.exe" APPLICATIONS EXPORT -dstfile:"%expfolder%\%expfilename%" -AppDN:All > "%Logfile%"
---------------------------------------------------------------------------------
To Export XenApp Policies :
---------------------------------------------------------------------------------
@echo off
set custname=My Customer
set farmname=MyFarm
set expfolder=\\MyServer\Exports
set expfilename=%date:~-2%%date:~3,2%%date:~0,2% - %farmname% - Policies %custname%.ctxtools
set logfile=\\MyServer\Exports\Logs\%date:~-2%%date:~3,2%%date:~0,2%-%farmname%-Policies.log
echo Processing Export File : %expfilename%
"%programfiles%\Citrix Tools\XenApp Policies Export Manager\XaPolMgrCmd.exe" POLICIES EXPORT -dstfile:"%expfolder%\%expfilename%" -PolName:All > "%Logfile%"
---------------------------------------------------------------------------------
2 comment(s) so far...
Re: Using CitrixTools.Net CLI Tools to Export XenApp Published Applications and Policies programmatically
i assume u can import it the same way just replacing APPExport / Policyexport with import ? would be nice when u cr8 a whole new farm based on applications of an older farm ...
By Justatry on
9/10/2009 11:25 AM
|
Re: Using CitrixTools.Net CLI Tools to Export XenApp Published Applications and Policies programmatically
Of Course !
Switches are a little different (like -srcfile instead of -dstfile) but it'll work !
The help (called with a question mark as command line argument will detail you all CLI settings)
By Pierre Marmignon on
9/10/2009 2:04 PM
|