Welcome Guest!   Register | Login | Login Assistance
Extending your Citrix and Terminal Server
environment using .NET and other technologies.

MFCOM Script to List Applications Only in Specified Folders

 

Here is a quick MFCOM script to list all the published applications and folders in a specified folder or folders. There are two options for using the script. Option one takes any number of command line arguments. Each command line argument represents a folder name. Option two takes no command line arguments and relies on hard-coded folder names within the script.

GetAppsInFolders.zip

Suppose you had the following tree structure for your published applications:

   

Now, say you wanted to run a script that only returned applications in the Testing folder and Microsoft Applications folder. To accomplish this, run the following at a command prompt: 


cscript //Nologo GetAppsInFolders.wsf  "Testing" "Microsoft Applications"


The above command produces the following results:




Note that every folder specified is a child of the "Applications" folder.  To specify a folder that is not a child of the "Applications" folder, you must specify the path relative from "Applications".  For instance, if you wanted to get only the applications published in the "New Folder" under "Testing", run the following command:

cscript //Nologo GetAppsInFolders.wsf  "Testing/New Folder"

The above command produces the following results:






To set up the hard-coded folders, open the script in a text editor and look for the following lines (starting around line 31):
    
' ' If no command line arguments, use hard-coded folders ' if WScript.Arguments.Count = 0 Then ReDim arrFolders(2) arrFolders(0) = "Testing" arrFolders(1) = "Microsoft Applications" Else
Change ReDim arrFolders(2) to ReDim arrFolders(x) where x represents the number of folders you want to hard code.
Next, add arrFolders(n) = "Folder Name" for each folder you want to hard code (where n is a distinct number between 0 and x).


So what is all this good for anyway?  Suppose you wanted to export applications in a few select folders, then import those applications in to a different farm.  This Citrix article demonstrates how to use EXPORT and NEWAPP from the Citrix APSDK.  Using EXPORT and NEWAPP along with GetAppsInFolders.wsf, you can export bulk applications from select specified folders and then import those applications into a different farm.






Published: August 28, 2006
Last Modified: November 08, 2007
Tags: Scripting Customization Citrix Presentation Server MFCOM
Current Rating:



Comments

pat.exe
U jason don't wanna be a spoiler but pat.exe already does it all? It exports the total farm and you can create your own .app files.

But heck if this goes faster I really gonna give it a try cause every new tool is welcome :)

greats
Hans Straat
www.datacrash.net

Reply
pat.exe
What is pat.exe and where do you get it?

Reply
Pat & Big farms
There are times when you don't want to export the details of all the apps in the farm and just the contents of a particular folder.

This script is something I have been looking for for a while. Thanks

Now to work out how to redirect it to Export.exe....

Reply

 
Post your comment:
Posting as: Guest. Don't want to post as Guest? Login or Register.
Title:  
Comment:  
Verification Code: