Link to home
Start Free TrialLog in
Avatar of SpencerKarnovski

asked on

How do you install a PRF file in a MS Exchange Environment.

Hello.  We have MS Exchange 2010.  We service about 550 users (we are a college).  We would like to implement a PRF file that will automatically enter in the user name, Exchange server etc etc when first booting up Outlook on all new/old profiles.

There are a lot of resources on actually how to create a PRF file - installed the necessary Outlook tools, save the PRF file etc etc..  But how do you go about actually installing/implementing the PRF - why does it get placed, how do you activate it so all profiles old and new will use it.  How have you implemented a PRF file?

All of our users have Outlook profiles setup already, we want to implement this so from now on any new users, and old users (if we delete a user profile and associated PST file for any reason), can start Outlook, then have the PRF file kick in and setup/take over the rest of the Outlook setup process.

Secondly, is there a way I can setup a test bed to test this out, as opposed to implementing it and hoping for the best. Would I need a virtual environment setup etc..


Avatar of Dmitriy Ilyin
Dmitriy Ilyin
Flag of Russian Federation image

Do you mean Windows Mail (Outlook express) or MS Outlook?
We would like to implement a PRF file that will automatically enter in the user name, Exchange server etc etc when first booting up Outlook on all new/old profiles.
Exchange Server 2010|2007 has nice future called autodiscover.
It allows to auto-configure almost all settings for MS Outlook.
Client will need to enter only email address and all settings get from Exchange.
Or even (if computer joined to domain) do not enter anything. Just click next-next-finish.

Take a look at Autodiscover WhitePaper
Avatar of SpencerKarnovski


Hello, I was talking about MS Outlook.   Thanks for the link, I shall have a read.

Am I right in saying, once you have setup your PRF file in the OCT, you then save that PRF file - then specify the command line option for Outlook.exe to run the said PRF file?
Avatar of Dmitriy Ilyin
Dmitriy Ilyin
Flag of Russian Federation image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Thanks for the link - helpful.

A question.

I'm going to deploy the prf file via a GP login script.  So, do I understand this process right (reading from the link you sent).

I need to create a registry key for the ImportPRF registry value that needs to be run, or injected into the users registry, when the login script is run.   You can see this from the "ImportPRF Registry Value" section on the page.

Just underneath that is a "Deployment Script" section, whereby he has provided a script that will make so the "First Run" value is not applied during each start, thus not adding a mail profile each time the user starts Outlook.

This script has to be run at a logon.

So, am I to assume that I first need to apply the ImportPRF registry value first, in a logon script, something like;

reg add HKCU\SOFTWARE\Microsoft\Office\12.0\Outlook\Setup /v ImportPRF /t REG_SZ /d "\\hermes\PRF\TestPRF.PRF"

Then run the deployprf script, from that page, via the GP?  So when users login firstly they will get the reg file inserted, which will point to the PRF file when Outlook runs.  Next executed will be the deploy.vbs script which will make sure they do not end up with multiple profiles attached to their profile.


hmm.... All users that already have outlook profile will take settings from PRF after you add registry settings.
But, if you create NEW user and he/she runs outlook FIRST time, they have FirstRun registry settings, so script with registry adds will not work for them. That's why you need deployprf script. And it should start for that users.  And as for me it shouldn't deployed via GPO.
But in general you are right.
Ok, appears to be working correctly.  When starting Outlook from a new profile, it automatically adds Exchange server/user details.  When starting Outlook from an existing profile it does not add another named profile to the list - Outlook starts as normal.  My only complaint is that it does ask the user to click OK to confirm their initials and once loaded the "Choose an update option" applet appears, which makes the makes the process not totally automated.

Here is the code I used, for anyone else having this problem.

To be added to a VBS script, that goes in - OU > GP>  User Con> Windows Set> Scripts>

set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKCU\SOFTWARE\Microsoft\Office\14.0\Outlook\Setup\ImportPRF", "\\Path\to\PRF file.PRF", "REG_SZ"

'This script determines if a specified mail profile already exists.
'If it doesn't, it will set the path to the prf-file containing
'the mail profile configuration settings.

'Script created by: Robert Sparnaaij
'For more information about this file see;

'=====BEGIN EDITING=====

'Name of mail profile as in the prf-file
ProfileName = "%username%"

'Path to the prf-file
ProfilePath = ""\\Path\to\PRF file.PRF"

'Increase the ProfileVersion whenever you want to reapply the prf-file
ProfileVersion = 1


const HKEY_CURRENT_USER = &H80000001
const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
    strComputer & "\root\default:StdRegProv")
strKeyProfilePath = _ 
	"Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" _ 
	& ProfileName & "\9375CFF0413111d3B88A00104B2A6676"
strLastChangeVer = "LastChangeVer"
objRegistry.GetBinaryValue _

If ProfileVersion > 1 Then
    strKeyProfileVersionPath = "SOFTWARE\HowTo-Outlook\DeployPRF"
    strProfileVersionName = ProfileName
    objRegistry.GetDWORDValue _

    If IsNull(strValueProfileVersion) OR ProfileVersion > strValueProfileVersion Then
	ReapplyPrf = True
    End If
End If

If IsNull(strValueLastChangeVer) OR ReapplyPrf Then
    'The mail profile doesn't exist yet so we'll set the the ImportPRF key and remove the FirstRun keys

    'Determine path to outlook.exe
    strKeyOutlookAppPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE"
    strOutlookPath = "Path"
    objRegistry.GetStringValue _

    'Verify that the outlook.exe and the configured prf-file exist
    Set objFSO = CreateObject("Scripting.FileSystemObject") 
    If objFSO.FileExists(strOutlookPathValue & "outlook.exe") AND objFSO.FileExists(ProfilePath) Then

	'Determine version of Outlook
	strOutlookVersionNumber = objFSO.GetFileVersion(strOutlookPathValue & "outlook.exe")
	strOutlookVersion = Left(strOutlookVersionNumber, inStr(strOutlookVersionNumber, ".0") + 1)

	'Create the Setup key, set the ImportPRF value and delete the First-Run values.
	strKeyOutlookSetupPath = "SOFTWARE\Microsoft\Office\" & strOutlookVersion & "\Outlook\Setup"

	strImportPRFValueName = "ImportPRF"
	strImportPRFValue = ProfilePath
	objRegistry.CreateKey HKEY_CURRENT_USER,strKeyOutlookSetupPath
	objRegistry.SetStringValue HKEY_CURRENT_USER,_

	strFirstRunValueName = "FirstRun"
	objRegistry.DeleteValue HKEY_CURRENT_USER,_

	strFirstRun2ValueName = "First-Run"
	objRegistry.DeleteValue HKEY_CURRENT_USER,_

	'Save the applied ProfileVersion if larger than 1.
	If ProfileVersion > 1 Then
	    objRegistry.CreateKey HKEY_CURRENT_USER,strKeyProfileVersionPath
	    objRegistry.SetDWORDValue HKEY_CURRENT_USER,_
	End If

        Wscript.Echo "Crucial file in script could not be found." &vbNewLine & _
        "Please contact your system administrator." 
    End If

    'The mail profile already exists so there is no need to launch Outlook with the profile switch.
    'Of course you are free to do something else here with the knowledge that the mail profile exists.
End If

Set objRegistry = Nothing
Set objFSO = Nothing

Open in new window