Configuring Outlook from a kix script is kinda easy. Have a look at the script below.

What does it do?
1 - Get the path to outlook.exe from the registry.
2 - Get the productversion of outlook.exe.
3 - Select the actions to take based on the version (11 = 2003 and 12 = 2007)
4 - Copy the default profile from the server to a private location for the user.
5 - Delete the FirstRun registry value so outlook does not prompt to setup a mail account the first time it is started.
6 - Set the ImportPRF registry value and point it to the location you copied the profile to.

The default profile can be created with the custom installation wizard that comes free as part of the resource kit on every Office 2003 CD or can be downloaded from the Microsoft website as part of the Office 2003 resource kit.

 Code:
Break on

;Get outlook version
$olpath = ReadValue("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", "Path")
$olversion = GetFileVersion($olpath + "outlook.exe", "ProductVersion")

Select
	Case Left($olversion, 2) = "11"
		;Outlook 2003
		Copy @LDRIVE + "\tools\outlook2003.prf" @HOMESHR + "\" + @USERID + "\outlook.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
	Case Left($olversion, 2) = "12"
		;Outlook 2007
		Copy @LDRIVE + "\tools\outlook2007.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "First-Run")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
EndSelect


[edit]
Now that I'm think about it it might be best to build in a check if outlook is actually installed and not do all this stuff when it is not.
I copied the code from my logon script and all clients always have outlook so it was not necessary to check for the presence of outlook.

something like:
 Code:
If  $olpath <> ""
	; configure outlook.
Else
	; do nothing.
EndIf

[/edit]


Edited by Mart (2008-09-22 03:14 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.