Monday, 30 January 2012

How to automate Microsoft Office for Terminal Services

If you are running terminal services performance tests with mandatory users (Citrix, RDS,  RDP) ,  you will probably want to use Microsoft Office apps.  However your mandatory users will be prompted to set up an account every time they open Outlook and as with other apps the users will keep being prompted to complete certain windows that normally appear for a first time user.  This stops your automated test script from working.

The following solution works for Office 2003,  2007 and 2010.  You should use Office 200x Enterprise if you want to test with numbers of TS users.

First you install your Office software on the test server.

Then you need to acquire a vbscript and a .prf file which you can download from the link below.  The vbscript I did not write,  the credits are in it.  The .prf file I cannot take credit for either :o)

Edit the vb script variable "arrVersions" so that it refers to the correct version of Office you are using (e.g. 12, 14)

You run the vb script within your test script.

When you start Outlook,  use the following : Outlook.exe /importprf  <path>\outlook.prf

The files can be found at

To get this to work on 2003 x86 or 64 bit you need to create an individual instance of the outlook.prf file for each user and use that to open Outlook. This is because if the file is open and another user accesses it then it will open a warning message,  asking you if you want to open Outlook in Safe Mode.

No comments:

Post a Comment