Automatically Create an Outlook Profile on Logon
Friday, November 9, 2007
I put together this process during a string of Exchange migration projects and it's really come in handy. There are hundreds of scenarios why you would want to automatically create the outlook profiles on logon.
One would be you are the system administrator of 100's of users and you're adding a new Exchange server. Rather than going around to explain to everyone the exchange server to type in to connect to, or having someone go around to 1000 workstations, you can script it like below.
Another would be as a sys admin, you have users that are switching workstations often and you're tired of all the calls complaining "My email doesn't work on so-and-so's machine" because they don't know how to set up their Outlook profiles.
Here's an overview of the process:
- Create a PRF that has all of the settings you want for the end users
- Create a logon script and apply it through a group policy to the end users
- The script runs at user logon and reads a registry entry to see if it has ever ran before [if it has then it quits]
- If this is the first time, it imports the PRF with all of the settings for the company automatically
Creating the PRF:
A PRF is a file that stores all the information for Outlook to create a profile for a user. There is no way to set the exchange server or which mailboxes to open through group policy so you have to rely on PRF files for administration and installation.
In this example, all I'm doing is pointing out where the exchange server is and that cached mode should be enabled. When you look at the Office Resource Kit [ORK] you will see that there are a lot more settings that you can play with than just the few here.
Here's what you need to do:
- Download Microsoft Office Resource Kit [ORK] and install it on any workstation
- Open the “Custom Installation Wizard” from the Start menu
- When prompted, point to an Office 2003 Installation source. Either an administration point on the network or a CD will do.
- Then when prompted choose, "Create a new MST" and click "Next.".
- At the top right of the window, click the drop down and skip to step 17 “Outlook: Customize Default Profile”
- Create a new profile and name it appropriately. Remember what you named it, you will need it to edit the script later
- Configure the settings appropriately with the Exchange server, whether or not you want “Cached Mode” and whatever other site specific settings you need
- Click Next and Next again to go to the “Export Profiles Settings” screen
- Click the “Export Profile Settings” button and save the PRF to a place on the network [\\server\share\ORK_profile.prf]
- Make sure that you test it on a workstation by running this command:
OUTLOOK /importprf \\server\share\ORK_profile.prf
EDIT: Thanks to Oliver for catching a colon that shouldn't be there.
Creating a Logon Script To Install The Outlook Profile
So there is a PRF file created that has all of the necessary settings and it has been tested to make sure that it works. Instead of running that command individually for each of the hundreds of users on the network, it's scripted.
This script [compared to a batch file] not only runs the command, it checks to see if the command has ever been run before and if the profile has already been created. If it has, then it exits and that's it. If it has not, it imports the PRF file and then adds a registry setting so that it never runs again.
Disclaimer: There are a ton of ways you can do this but the end result should be that the script below runs on each machine. You could just instruct the users to run the script manually but this way, when a new user is added to the network, they will automatically have their profile set up.
Here's an overview of one way to set it up:
- Copy this script to a text file and then save it as a .VBS to make it a vbs script:
- Edit the script under where it says "EDIT THIS INFORMATION" [see Step #6 above]
For instance:
- Save the vbscript to the netlogon folder or somewhere appropriate on the network [\\domain.local\netlogon\auto_outlook.vbs]
- If necessary, create a group policy to apply the new logon script [or edit an existing one to add this script.]
4a. [OPTIONAL] If you have some kind of software on the clients that protects against using vbscript at logon, already have an existing batch script that runs at logon, or like some admins I know are just against using vbscripts at logon completely, you can call the script from a batch file by running the "CScript" command. Include the command as something like this:
- Test by running your logon script from a workstation. Check the following
- The registry key was created [HKCU\Software\%COMPANY%\FirstRunFlag
- The profile with the appropriate name was created [even if a profile already exists]
Control Panel > Mail > Show Profiles
- The exchange server and information is configured correctly
External Links:
http://office.microsoft.com/en-us/ork2003/HA011402581033.aspx - Link about using PRF files
http://www.microsoft.com/downloads/details.aspx?FamilyID=4bb7cb10-a6e5-4334-8925-3bcf308cfbaf&displaylang=en – download the Microsoft Office 2003 Resource kit
I put together this process during a string of Exchange migration projects and it's really come in handy. There are hundreds of scenarios why you would want to automatically create the outlook profiles on logon.
One would be you are the system administrator of 100's of users and you're adding a new Exchange server. Rather than going around to explain to everyone the exchange server to type in to connect to, or having someone go around to 1000 workstations, you can script it like below.
Another would be as a sys admin, you have users that are switching workstations often and you're tired of all the calls complaining "My email doesn't work on so-and-so's machine" because they don't know how to set up their Outlook profiles.
Here's an overview of the process:
- Create a PRF that has all of the settings you want for the end users
- Create a logon script and apply it through a group policy to the end users
- The script runs at user logon and reads a registry entry to see if it has ever ran before [if it has then it quits]
- If this is the first time, it imports the PRF with all of the settings for the company automatically
Creating the PRF:
A PRF is a file that stores all the information for Outlook to create a profile for a user. There is no way to set the exchange server or which mailboxes to open through group policy so you have to rely on PRF files for administration and installation.
In this example, all I'm doing is pointing out where the exchange server is and that cached mode should be enabled. When you look at the Office Resource Kit [ORK] you will see that there are a lot more settings that you can play with than just the few here.
Here's what you need to do:
- Download Microsoft Office Resource Kit [ORK] and install it on any workstation
- Open the “Custom Installation Wizard” from the Start menu
- When prompted, point to an Office 2003 Installation source. Either an administration point on the network or a CD will do.
- Then when prompted choose, "Create a new MST" and click "Next.".
- At the top right of the window, click the drop down and skip to step 17 “Outlook: Customize Default Profile”
- Create a new profile and name it appropriately. Remember what you named it, you will need it to edit the script later
- Configure the settings appropriately with the Exchange server, whether or not you want “Cached Mode” and whatever other site specific settings you need
- Click Next and Next again to go to the “Export Profiles Settings” screen
- Click the “Export Profile Settings” button and save the PRF to a place on the network [\\server\share\ORK_profile.prf]
- Make sure that you test it on a workstation by running this command:
OUTLOOK /importprf \\server\share\ORK_profile.prf
Creating a Logon Script To Install The Outlook Profile
So there is a PRF file created that has all of the necessary settings and it has been tested to make sure that it works. Instead of running that command individually for each of the hundreds of users on the network, it's scripted.
This script [compared to a batch file] not only runs the command, it checks to see if the command has ever been run before and if the profile has already been created. If it has, then it exits and that's it. If it has not, it imports the PRF file and then adds a registry setting so that it never runs again.
Disclaimer: There are a ton of ways you can do this but the end result should be that the script below runs on each machine. You could just instruct the users to run the script manually but this way, when a new user is added to the network, they will automatically have their profile set up.
Here's an overview of one way to set it up:
- Copy this script to a text file and then save it as a .VBS to make it a vbs script:
- Edit the script under where it says "EDIT THIS INFORMATION" [see Step #6 above]
For instance:
- Save the vbscript to the netlogon folder or somewhere appropriate on the network [\\domain.local\netlogon\auto_outlook.vbs]
- If necessary, create a group policy to apply the new logon script [or edit an existing one to add this script.]
4a. [OPTIONAL] If you have some kind of software on the clients that protects against using vbscript at logon, already have an existing batch script that runs at logon, or like some admins I know are just against using vbscripts at logon completely, you can call the script from a batch file by running the "CScript" command. Include the command as something like this:
- Test by running your logon script from a workstation. Check the following
- The registry key was created [HKCU\Software\%COMPANY%\FirstRunFlag
- The profile with the appropriate name was created [even if a profile already exists]
Control Panel > Mail > Show Profiles
- The exchange server and information is configured correctly
External Links:
http://office.microsoft.com/en-us/ork2003/HA011402581033.aspx - Link about using PRF files
http://www.microsoft.com/downloads/details.aspx?FamilyID=4bb7cb10-a6e5-4334-8925-3bcf308cfbaf&displaylang=en – download the Microsoft Office 2003 Resource kit
<< Home