MFCOM Script to List Applications Only in Specified Folders

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.

Visual MFCOM Explorer

Have you ever wanted to delve into the intricacies of MFCOM? Using this web application, you can browse the various MFCOM properties using the Citrix Presentation Server Console as your guide.

If you are like me, you have read the MFCOM documentation and found it pretty thorough. But, I found myself printing out screen shots of the Citrix Presentation Server Console and making notes of the various MFCOM properties that corresponded to the sections of the GUI. So, what I decided to do was share my notes in an electronic format. Thus, the Visual MFCOM Explorer was created. Visual MFCOM Explorer is a web application used to browse the various MFCOM properties using the Citrix Presentation Server Console as your guide.

Go to the Visual MFCOM Explorer website.

Note: this is a work in progress, but I decided to share what I have so far with the community.