Hi Guys,
I use the following script and yes I found it on the web somewhere so I cant take full credit for this!
Copy Code 1 to your logon.bat located in SYSVOL
Copy Code 2 to notepad, Save as ".vbs" in SYSVOL
Copy your pre-made .prf into SYSVOL
The following script will look for the users directory to see if they already have an Outlook folder in Application Data, if not then the script will proceed with importing the .prf
In you logon.bat file you'll need to add the following:
CODE 1
Code:
cscript \\SERVER\netlogon\Outlook2007.vbs
Now copy this to notepad and save as .VBS
CODE 2
Code:
Dim objNetwork, strUserName, WshShell, strDirectory, objFSO
Dim objShell
Dim Version
' Create Outlook object and Shell object
set objShell = CreateObject("WScript.Shell")
'Get user's name
Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
'See if the user needs Outlook configured
strDirectory = "C:\Documents and Settings\" & strusername & "\Application Data\Microsoft\Outlook"
' Create the various objects
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Import PRF
If objFSO.FolderExists(strDirectory) Then
'Wscript.Echo "Skipped the registry edits. Directory exists
Else
'Wscript.Echo "Start performing registry edits. Directory does not exist
On Error Resume Next
Err.Clear
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegDelete "HKCU\Software\Microsoft\Office\12.0\Outlook\Setup\First-Run"
WshShell.RegDelete "HKCU\Software\Microsoft\Office\12.0\Outlook\Setup\FirstRun"
WshShell.RegWrite "HKCU\Software\Microsoft\Office\12.0\Outlook\Setup\ImportPRF","\\SERVER\netlogon\Outlook.PRF","REG_SZ"
'Wscript.Echo "Finished modifying registry
End If