Creating Outlook Profiles for RemoteApps

Recently I have been involved in a project to roll out Microsoft RemoteApps, so users can launch applications on a terminal server via a website or shortcut. One of the issues we had was with a business application that was trying to send email out via Outlook.

The application was trying to open a new outlook email, but as outlook had never been launched before the application just hit an error as soon as it tried to send the email. I came across a few articles that pointed at adding a entry to the registry at HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\ImportPRF that contains a path to a prf file. When you set this path when Outlook first opens it will use this entry to create the profile based on the settings in the PRF file.

The problem I had was because Outlook was not actually being opened by the user, then the profile was never created, so they got an error. So in order to get around this, I decided to write a VB script that would create a Outlook object then launch the application. I would then use this as the application path in RemoteApp Manager to start the application.

The Solution

This is the script I wrote to launch my application:

SetobjRegistry = CreateObject(“”)

objRegistry.RegWrite “HKCU\Software\Microsoft\Office\14.0\Outlook\Setup\ImportPRF”, “\\server\share\settings.prf”, “REG_SZ”


SetobjOutlook = CreateObject(“Outlook.Application”)

SetobjNamespace = objOutlook.GetNamespace(“MAPI”)

SetobjFolder = objNamespace.GetDefaultFolder(6)

objRegistry.Run “%SYSTEMDRIVE%\Progam Files\App1\App1.exe”

So, what is the script doing. First of all we create a shell object so we can write to the registry. Then we write the key to point at our prf file (obviously you need to change this to your relevant path, and if you are not running Outlook 2010 the reg path will be different).

Now we have that setting in the reg, we create an object pointing at Outlook. As we do this Outlook essentially ‘runs’ and sets its self up based on the info in the prf. We then just shell out to the application we want to run, and an Outlook profile should be available for the application to use!


About Mahyar

OrcID: 0000-0001-8875-3362 ​PhD Candidate (National Academy of Sciences of Ukraine - Institute for Telecommunications and Global Information) MCP - MCSA - MCSE - MCTS Azure Security Engineer Associate MCITP: Enterprise Administrator CCNA, CCNP (R&S , Security) ISO/IEC 27001 Lead Auditor CHFI v10 ECIH v2

Check Also

نصب .Net Framework 3.5در ویندوز 8 و 2012 به صورت آفلاین

در قدم اول باید Command Prompt  را به صورت Run As Administratorباز کنید. بدین منظور …