Script to Manipulate APPSRV.INI

What happens when you need to make mass changes to APPSRV.INI? Use this script to make changes to your user’s APPSRV.INI file via login script. The script adds or modifies .INI file key/value pairs and sections.

Use this script to make changes to your user’s APPSRV.INI file via login script. The script adds or modifies .INI file key/value pairs and sections.

  Download mod_appsrv script v1.1

The Scenario
So, you have been combing through the various support forums all day long trying to find a solution for an issue. You finally find the solution, but it involves modifying every user’s APPSRV.INI file located on their workstation. One common solution that matches the above scenario has to do with Single Sign On issues with Citrix Web Interface. One of the most recommended solutions is to add the following two lines to the [WFClient] section of APPSRV.INI:



The Dilemma
So, you try this and it fixes the issue for the user. What do you do now? Manually modify each user’s APPSRV.INI? Tell your users to perform the modification themselves? Script the change? Tell your boss there is no fix for the issue?

The Solution
Script the change sounds good to me, but how do you do that? That is where this article comes in. I mentioned I had a script to manipulate APPSRV.INI in the comments of this article. I have received many emails requesting the script. So, I decided to “spruce up” the script a little by adding more comments and logging and then share it. The script is written in such a way that you can add or modify any key/value pair to any section in APPSRV.INI (or any .INI file for that matter). Just modify the following section of the script to suit your needs:

' Add/modify key/value pairs
' modINISection takes 3 parameters:
'    Section name
'    Key
'    Value
modINISection "WFClient", "SSOnUserSetting", "On"
modINISection "WFClient", "EnableSSOnThruICAFile", "On"

The above example shows how to implement the solution to the delimma discussed earlier.

Here is another useful one to add that addresses clipboard issues:

modINISection "WFClient", "CbChainInterval", "2000"

From the Citrix Client 9.100 Readme

“This fix introduces support for a mechanism to check at periodic intervals the client’s ability to receive clipboard change notifications. If the mechanism finds the client to be unable to receive such notifications, the client will attempt to register itself to receive future notifications. To enable this functionality, you must modify users’ appsrv.ini files as follows: 1. Open the appsrv.ini file located in the user profile directory using a text editor. 2. In the WFClient section, locate or add the entry: CbChainInterval=<value>, where value is the interval, in milliseconds, at which checks are to be performed. Supported values range from 0 to 2,000, inclusive.”

Think of it as an auto RepairCDBChain.exe

Some quick things to note about the script:

  • If you specify a section for modINISection that does not exist, the section will be created.
  • If you specify a key that does not exist, the key will be created at the end of the section.
  • Curretnly, there is no implementation to delete key/value pairs (I’m not sure that would even be useful for the intended usage)
  • A log file is created in the same directory as the APPSRV.INI file. The log file is named the same as the script name. If you change the script name to match you company’s naming convetion, the log file name will change automatically.

Good luck and have fun. But, as always, test test test. Make sure this script works in your environment before you throw it out there on your global login script.

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.

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"

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.