#106585 - 2003-11-03 11:46 PM
Re: Outlook 2002
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Is this on a new image? If you have configured the machine previously to use Exchange, it should work fine. Or, am I missing it?
Kent
|
|
Top
|
|
|
|
#106587 - 2003-11-03 11:51 PM
Re: Outlook 2002
|
Bob Deerinwater
Starting to like KiXtart
Registered: 2002-05-05
Posts: 101
Loc: Covina California
|
Also was outlook setup the first time with administrative rights. i have had the issue that the first time that a user opens outlook it needs to be with admin rights. in order to get rid of the install
|
|
Top
|
|
|
|
#106589 - 2003-11-03 11:58 PM
Re: Outlook 2002
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I guess I am kind of confused.. You state in the initial post that it does work fine after the initial script run-through? Is that correct?
Kent
|
|
Top
|
|
|
|
#106592 - 2003-11-04 12:15 AM
Re: Outlook 2002
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Let me get a machine build rolling.. I need to do a plain install of Office (Outlook).. I will do a registry sniff to see what is up.
Kent
|
|
Top
|
|
|
|
#106596 - 2003-11-04 02:04 AM
Re: Outlook 2002
|
It_took_my_meds
Hey THIS is FUN
   
Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
|
Sorry Erik, I tried it and it didn't fix the problem Thanks, Richard
|
|
Top
|
|
|
|
#106597 - 2003-11-04 04:07 AM
Re: Outlook 2002
|
It_took_my_meds
Hey THIS is FUN
   
Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
|
Hi All,
I must send my sincerest apologies! I discovered what the problem was! I was placing the custom profile in the temporary directory and later on in the script deleted it to be tidy. Unfortunately when the user first logs on it takes longer for outlook to start and it seems that by the time it got around to actually reading the profile it was gone!
I no longer delete the profile at the end of the script and it works as it should. Thanks again for everyone's suggestions and sorry for wasting your time.
Regards,
Richard
|
|
Top
|
|
|
|
#106598 - 2003-11-04 06:42 AM
Re: Outlook 2002
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Richard,
Did you make some changes to the code? If so, what are they? We might be able to use this information.
Thanks for bringing this up!!
Kent
|
|
Top
|
|
|
|
#106599 - 2003-11-04 11:34 PM
Re: Outlook 2002
|
It_took_my_meds
Hey THIS is FUN
   
Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
|
Hi Kent,
Below is my code, I run a GUI logon script and have I have therefore removed the GUI features from the code below. I also log the progress of the script as I have routine that emails relevant IT staff the log file if the script comes up with errors.
I guess that main change I have made to your code is that the new profile generation will only occur if a correct existing profile is not already setup for that specific user. If you think any of the mods are useful please feel free to include any in your code.
Thanks again,
Richard
code:
:Outlook
$=Log("Microsoft Outlook",,Chr(175))
$Company="CSIRO" ; Do you want users to delete all deleted items on Exit from Outlook? $DeleteItems = "Yes" ; Is it Winnt or 2K? If (@Inwin = 1) ; Windows NT Registry Locations $ProfileLocation="HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" Else ; Windows 9x Registry Locations $ProfileLocation="HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles\" EndIf
$OutlookExe=ReadValue("HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\Outlook.EXE","") ; Get version of executable for MS-Outlook $OutlookVersion=GetFileVersion($OutlookExe) $Vers=SubStr($OutlookVersion,1,InStr($OutlookVersion,".")+1) ; Log the outlook version $=Log(Spacing("Version",50)+"- ") Select Case $Vers="8.0" $=Log("Outlook 98",1) Case $Vers="9.0" $=Log("Outlook 2000",1) Case $Vers="10.0" $=Log("Outlook 2002",1) Case $Vers="11.0" $=Log("Outlook 2003",1) Case 1 $=Log("No known version of Outlook is installed",2) Sleep 0.75 Return EndSelect
$=Log(Spacing("Checking for configured profile",50)+"- ")
$DefaultProfile=ReadValue($ProfileLocation,"DefaultProfile")
; If no default profile exists, the outlook profile is not the default or the default profile is incorrectly configured, ; setup a new profile for the user If $DefaultProfile="" OR NOT KeyExist($ProfileLocation+$DefaultProfile) OR NOT InStr(ReadValue($ProfileLocation+$DefaultProfile+"\13dbb0c8aa05101a9bb000aa002fc45a","001e3001"),$LastName) Select Case $DefaultProfile="" $=Log("No default profile exists",1) $=Log("Creating profile",1) $Progress.currentprogress=$Progress.currentprogress+1 Case NOT KeyExist($ProfileLocation+$DefaultProfile) $=Log("Outlook profile is not the default",1) $=Log("Reconfiguring profile",1) $Progress.currentprogress=$Progress.currentprogress+1 Case NOT InStr(ReadValue($ProfileLocation+$DefaultProfile+"\13dbb0c8aa05101a9bb000aa002fc45a","001e3001"),$LastName) $=Log("Default profile is incorrectly configured",1) $=Log("Reconfiguring profile",1) $Progress.currentprogress=$Progress.currentprogress+1 EndSelect ; Copy the default profile to the temporary directory Copy $ExePath+"\Outlook\Custom.PRF" $temp $CustomProfile = $temp+"\Custom.PRF" If $HomeDrive="" $HomeDrive="U:" EndIf ; Change the PRF file from %username% to @USERID $=Log(Spacing("Profile Name",50)+"- @USERID",1) ; Profile name $=WriteProfileString($CustomProfile,"General","ProfileName","@USERID") ; Auto archive file $=Log(Spacing("Auto Archive File",50)+"- "+$HomeDrive+"\@USERID.pst",1) $=WriteProfileString($CustomProfile,"General","AutoArchiveFile",$HomeDrive+"\@USERID.pst") ; Auto archive file $=WriteProfileString($CustomProfile,"Service1","AutoArchiveFile",$HomeDrive+"\@USERID.pst") ; Mail box name $=Log(Spacing("Mail Box Name",50)+"- @USERID",1) $=WriteProfileString($CustomProfile,"Service1","MailBoxName","@USERID") ; Mail box name $=WriteProfileString($CustomProfile,"Service2","MailBoxName","@USERID") ; Exchange server $=Log(Spacing("Exchange Server",50)+"- "+$ExchangeServer,1) $=WriteProfileString($CustomProfile,"Service2","HomeServer",$ExchangeServer) ; Personal folder location $=Log(Spacing("Path To Personal Folders",50)+"- ") If $MapPref="Yes" $=Log($HomeDrive+"\@USERID.pst",1) $=WriteProfileString($CustomProfile,"Service3","PathToPersonalFolders",$HomeDrive+"\@USERID.PST") Else $=Log($Temp+"\@USERID.pst",1) $=WriteProfileString($CustomProfile,"Service3","PathToPersonalFolders",$Temp+"\@USERID.PST") EndIf
$OfficeLM = "HKLM\Software\Microsoft\Office" $OfficeCU = "HKCU\Software\Microsoft\Office"
; Process Company Name For $x = 1 to Len($Company) $Companybin=$Companybin+DecToHex(Asc(SubStr($Company,$x,1)))+"00" Next $Companybin=$Companybin+"0000" $=WriteValue("HKCU\Software\Microsoft\Office\"+$Vers+"\Common\UserInfo","Company",$Companybin,"REG_BINARY") ; Process FullName For $x = 1 to Len(@fullname) $Fullnamebin=$Fullnamebin+DecToHex(Asc(SubStr(@fullname,$x,1)))+'00' Next $FullNamebin=$FullNamebin+"0000" $=WriteValue("HKCU\Software\Microsoft\Office\"+$Vers+"\Common\UserInfo","UserName",$FullNamebin,"REG_BINARY")
; Process Initials $Initials=DecToHex(Asc(SubStr($FirstName,1,1)))+"000000" $=WriteValue("HKCU\Software\Microsoft\Office\"+$Vers+"\Common\UserInfo","UserInitials",$Initials,"REG_BINARY")
Select ; If it is Outlook 98 or Outlook 2000, configure the following keys and values (e.g. 9.0.0.2416) Case $Vers="8.0" OR $Vers = "9.0" $=Log(Spacing("Outlook Version",50)+"- ") If $Vers="8.0" $=Log("Outlook 98",1) EndIf If $Vers="9.0" $=Log("Outlook 2000",1) EndIf ; Generate the Inbox
; If you use RUN instead of SHELL, the script will pause and not complete properly Shell $ExePath+"\Outlook\Profgen.exe "+$ExePath+"\Outlook\NEWPROF.EXE -P "+$CustomProfile+" -X -R" If @ERROR $=Log(Spacing("Creating Profile",50)+"- "+@SERROR,2,,"Outlook Profile creation on @WKSTA did not run correctly") Else $=Log(Spacing("Creating Profile",50)+"- "+@SERROR,2) EndIf $Progress.currentprogress=$Progress.currentprogress+1
; Create default profile $=WriteValue($ProfileLocation,"DefaultProfile", @USERID, "REG_SZ") ; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated If $DeleteItems = "Yes" $=WriteValue($ProfileLocation+@USERID+"\0a0d020000000000c000000000000046","000b0115","0100","REG_BINARY") EndIf $Progress.currentprogress=$Progress.currentprogress+1 ; Company $=WriteValue($OfficeCU+"\"+$Vers+"\Common\UserInfo","Company","435349524F","REG_BINARY") ; Set the Machine Name $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook","Machine Name",@WKSta,"REG_SZ") ; Check Internet E-Mail Accounts $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook","CheckInternetAccounts","1","REG_DWORD") ; Has Outlook been Setup? $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook","FirstRunDialog","False","REG_SZ") ; Primary Client? $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Setup","PrimaryClient","1","REG_DWORD") ; Corporate or POP3? - Needs to be a machine setting $=WriteValue($OfficeLM+"\"+$Vers+"\Outlook\Setup","MailSupport","1","REG_DWORD") ; Corporate or POP3? - Needs to be a machine setting $=WriteValue($OfficeLM+"\"+$Vers+"\Outlook\Setup","First-Run","df83b12adc9cd511b57c0002a57ce19c","REG_BINARY")
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Options\Mail","EditorPreference","196609","REG_DWORD")
$=WriteValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"+@USERID+"\0a0d020000000000c000000000000046","001e0360","","REG_SZ")
; Changes the view to get rid of the Outlook Bar and show the "Explorer View" $Expview = "010000002c0000000200000003000000ffffffffffffffffffffffffffffffff62000000270000003c030000ac02000001000000000000000100000000000000c00000006400000003000000" $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Office Explorer","Frame",$Expview,"REG_BINARY")
; Set the default Font to be Verdana 10 pt $PlTextFont = "3c0000000f0000e800000040c80000000600000000000000002056657264616e61000200000000000000000000000000201a493a38e9070001000000" $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Preferences","PlainTextFont",$PlTextFont,"REG_BINARY") ; If it is Outlook 2002 or 2003, configure the following keys and values Case $Vers = "10.0" OR $Vers="11.0" $=Log(Spacing("Outlook Version",50)+"- ") If $Vers="10.0" $=Log("Outlook 2002",1) EndIf If $Vers="11.0" $=Log("Outlook 2003",1) EndIf ; No extra EXEs or files other than the PRF needed for Outlook 2002 or 2003 ; This is discussed at: http://www.slipstick.com/outlook/ol2002/prftips.htm $=WriteProfileString($CustomProfile,"General","BackupProfile","NO") ; This is discussed at the bottom of - http://www.microsoft.com/office/ork/xp/four/outc03.htm $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Setup","ImportPRF",$CustomProfile,"REG_SZ") $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook","Machine Name","@WKSTA","REG_SZ") $=DelValue($OfficeCU+"\"+$Vers+"\Outlook\Setup","First-run") ; Import the profile for outlook Run $OutlookExe+" /importprf "+$CustomProfile If @ERROR $=Log(Spacing("Creating Profile",50)+"- "+@SERROR,2,,"Outlook Profile creation on @WKSTA did not run correctly") Else $=Log(Spacing("Creating Profile",50)+"- "+@SERROR,2) EndIf Sleep 1
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Options\Mail","EditorPreference","196609","REG_DWORD") ; Set the default mail editor to word $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Options\Mail","UseWordMail","1","REG_DWORD") ; Set the default Font to be Verdana 10 pt $PlTextFont = "3c0000000f0000e800000040c80000000600000000000000002056657264616e61000200000000000000000000000000201a493a38e9070001000000" $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Preferences","TextFontSimple",$PlTextFont,"REG_BINARY")
; Changes the view to get rid of the Outlook Bar and show the "Explorer View" $Expview = "010000002c0000000200000003000000ffffffffffffffffffffffffffffffff2c0000002c00000084020000dc01000001000000000000000100000000000000c0000000640000001800000003000000" $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Office Explorer","Frame",$expview,"REG_BINARY")
;Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated If $DeleteItems = "Yes" $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\Preferences","EmptyTrash","1","REG_DWORD") EndIf ; Disable Instant Messaging $=WriteValue($OfficeCU+"\"+$Vers+"\Outlook\IM","Enabled","0","REG_DWORD")
EndSelect
Else $=Log("Outlook Profile is already configured",2) EndIf
Sleep 0.75
Return
|
|
Top
|
|
|
|
#106600 - 2003-11-05 02:02 PM
Re: Outlook 2002
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Richard,
I like what you have done with the script! Good stuff.
I am going to do some addtional testing.
Comments:
- I commented out the "Explorer View" under version 10/11 {XP/2003} (especially 11) as Microsoft re-vamped the Outlook Interface..
- IM (under version 10/11) - should this not not be written to the Registry out before running Outlook?
- Have you tried to get profile generation working with TransForms as the Office Resource Kit? I think this would be the preferred method, but I have yet to have success with it.
Here is what I have at this point:
code:
$company='CSIRO' ; Do you want users to delete all deleted items on Exit from Outlook? $deleteitems='Yes'
IF @inwin=1 ; Windows NT Registry Locations $profilelocation='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\' ELSE ; Windows 9x Registry Locations $profilelocation='HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles\' ENDIF
$outlookexe=ReadValue('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\Outlook.EXE','') ; Get version of executable for MS-Outlook $outlookversion=GetFileVersion($outlookexe) $vers=SubStr($outlookversion,1,InStr($outlookversion,'.')+1)
$defaultprofile=ReadValue($profilelocation,'DefaultProfile')
; If no default profile exists, the outlook profile is not the default or the default profile is incorrectly configured, ; setup a new profile for the user IF $defaultprofile='' OR NOT KeyExist($profilelocation+$defaultprofile) OR NOT InStr(ReadValue($profilelocation+$defaultprofile+'\13dbb0c8aa05101a9bb000aa002fc45a','001e3001'),$lastname)
; Copy the default profile to the temporary directory COPY $exepath+'\Outlook\Custom.PRF' $temp $customprofile=$temp+'\Custom.PRF' IF $homedrive='' $homedrive='U:' ENDIF ; Change the PRF file from %username% to @USERID ; Profile name $=WriteProfileString($customprofile,'General','ProfileName','@USERID') ; Auto archive file $=WriteProfileString($customprofile,'General','AutoArchiveFile',$homedrive+'\@USERID.pst') ; Auto archive file $=WriteProfileString($customprofile,'Service1','AutoArchiveFile',$homedrive+'\@USERID.pst') ; Mail box name $=WriteProfileString($customprofile,'Service1','MailBoxName','@USERID') ; Mail box name $=WriteProfileString($customprofile,'Service2','MailBoxName','@USERID') ; Exchange server $=WriteProfileString($customprofile,'Service2','HomeServer',$exchangeserver) ; Personal folder location IF $mappref='Yes' $=WriteProfileString($customprofile,'Service3','PathToPersonalFolders',$homedrive+'\@USERID.PST') ELSE $=WriteProfileString($customprofile,'Service3','PathToPersonalFolders',$temp+'\@USERID.PST') ENDIF
$officelm='HKLM\Software\Microsoft\Office' $officecu='HKCU\Software\Microsoft\Office'
; Process Company Name FOR $x=1 TO Len($company) $companybin=$companybin+DecToHex(Asc(SubStr($company,$x,1)))+'00' NEXT $companybin=$companybin+'0000' $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','Company',$companybin,'REG_BINARY') ; Process FullName FOR $x = 1 TO Len(@fullname) $fullnamebin=$fullnamebin+DecToHex(Asc(SubStr(@fullname,$x,1)))+'00' NEXT $fullnamebin=$fullnamebin+'0000' $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','UserName',$fullnamebin,'REG_BINARY')
; Process Initials $initials=DecToHex(Asc(SubStr($firstname,1,1)))+'000000' $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','UserInitials',$initials,'REG_BINARY')
SELECT ; If it is Outlook 98 or Outlook 2000, configure the following keys and values (e.g. 9.0.0.2416) CASE $Vers='8.0' OR $Vers = '9.0' ; Generate the Inbox ; If you use RUN instead of SHELL, the script will pause and not complete properly SHELL $exepath+'\Outlook\Profgen.exe '+$exepath+'\Outlook\NEWPROF.EXE -P '+$customprofile+' -X -R' ; Create default profile $=WriteValue($profilelocation,'DefaultProfile', @userid, 'REG_SZ') ; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated IF $deleteitems = 'Yes' $=WriteValue($profilelocation+@userid+'\0a0d020000000000c000000000000046','000b0115','0100','REG_BINARY') ENDIF ; Company $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','Company','435349524F','REG_BINARY') ; Set the Machine Name $=WriteValue($officecu+'\'+$vers+'\Outlook','Machine Name',@wksta,'REG_SZ') ; Check Internet E-Mail Accounts $=WriteValue($officecu+'\'+$vers+'\Outlook','CheckInternetAccounts','1','REG_DWORD') ; Has Outlook been Setup? $=WriteValue($officecu+'\'+$vers+'\Outlook','FirstRunDialog','False','REG_SZ') ; Primary Client? $=WriteValue($officecu+'\'+$vers+'\Outlook\Setup','PrimaryClient','1','REG_DWORD') ; Corporate or POP3? - Needs to be a machine setting $=WriteValue($officelm+'\'+$vers+'\Outlook\Setup','MailSupport','1','REG_DWORD') ; Corporate or POP3? - Needs to be a machine setting $=WriteValue($officelm+'\'+$vers+'\Outlook\Setup','First-Run','df83b12adc9cd511b57c0002a57ce19c','REG_BINARY')
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Mail','EditorPreference','196609','REG_DWORD')
$=WriteValue($profilelocation+@userid+'\0a0d020000000000c000000000000046','001e0360','','REG_SZ') ; Changes the view to get rid of the Outlook Bar and show the 'Explorer View' $expview='010000002c0000000200000003000000ffffffffffffffffffffffffffffffff' $expview=$expview+'62000000270000003c030000ac02000001000000000000000100000000000000' $expview=$expview+'c00000006400000003000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY') ; Set the default Font to be Verdana 10 pt $pltextfont='3c0000000f0000e800000040c80000000600000000000000002056657264616e61' $pltextfont=$pltextfont+'000200000000000000000000000000201a493a38e9070001000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Preferences','PlainTextFont',$pltextfont,'REG_BINARY') ; If it is Outlook 2002 or 2003, configure the following keys and values CASE $Vers = '10.0' OR $Vers='11.0' ; No extra EXEs or files other than the PRF needed for Outlook 2002 or 2003 ; This is discussed at: http://www.slipstick.com/outlook/ol2002/prftips.htm $=WriteProfileString($customprofile,'General','BackupProfile','NO') ; This is discussed at the bottom of - http://www.microsoft.com/office/ork/xp/four/outc03.htm $=WriteValue($officecu+'\'+$vers+'\Outlook\Setup','ImportPRF',$customprofile,'REG_SZ') $=WriteValue($officecu+'\'+$vers+'\Outlook','Machine Name','@WKSTA','REG_SZ') $=DelValue($officecu+'\'+$vers+'\Outlook\Setup','First-run') ; Import the profile for outlook RUN $outlookexe+' /importprf '+$customprofile SLEEP 1
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Mail','EditorPreference','196609','REG_DWORD') ; Set the default mail editor to word $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Mail','UseWordMail','1','REG_DWORD') ; Set the default Font to be Verdana 10 pt $pltextfont='3c0000000f0000e800000040c80000000600000000000000002056657264616e610002' $pltextfont=$pltextfont+'00000000000000000000000000201a493a38e9070001000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Preferences','TextFontSimple',$pltextfont,'REG_BINARY') ; Changes the view to get rid of the Outlook Bar and show the 'Explorer View' ;>>> Under OutlooK XP 2003, I would be careful about this.. ;$expview='010000002c0000000200000003000000ffffffffffffffffffffffffffffffff' ;$expview=$expview+'2c0000002c00000084020000dc01000001000000000000000100000' ;$expview=$expview+'2000000000c0000000640000001800000003000000' ;$=WriteValue($officecu+'\'+$vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY') ;Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated IF $deleteitems = 'Yes' $=WriteValue($officecu+'\'+$vers+'\Outlook\Preferences','EmptyTrash','1','REG_DWORD') ENDIF ; Disable Instant Messaging $=WriteValue($officecu+'\'+$vers+'\Outlook\IM','Enabled','0','REG_DWORD') ENDSELECT ELSE ENDIF SLEEP 0.75 RETURN
Kent [ 05. November 2003, 14:12: Message edited by: kdyer ]
|
|
Top
|
|
|
|
#106601 - 2003-11-05 11:20 PM
Re: Outlook 2002
|
It_took_my_meds
Hey THIS is FUN
   
Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
|
Hi Kent
I'm really glad you like some of my mods. To answer your question regarding Instant messaging, I find that it gets disabled with the reg setting in its current place so I am happy to leave it. As for using the transforms, shame on you I find that scripting will almost always give a finer degree of control.
We have been able to get the transforms working but they don't fulfil our requirements. By using the outlook code we setup archiving to the user's personal file server share. This gives good intellectual property management and enables the user to see their personal/archive folder if they logon to another machine.
I've changed the code slightly below. I have now added a a reg setting to switch on spell checking and have added a str2hex function.
Cheers,
Richard
code:
:Outlook
$Company='CSIRO' ; Do you want users to delete all deleted items on Exit from Outlook? $DeleteItems = 'Yes' ; Is it Winnt or 2K? If (@Inwin = 1) ; Windows NT Registry Locations $ProfileLocation='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\' Else ; Windows 9x Registry Locations $ProfileLocation='HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles\' EndIf
$OutlookExe=ReadValue('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\Outlook.EXE','') ; Get version of executable for MS-Outlook $OutlookVersion=GetFileVersion($OutlookExe) $Vers=SubStr($OutlookVersion,1,InStr($OutlookVersion,'.')+1)
$DefaultProfile=ReadValue($ProfileLocation,'DefaultProfile')
; If no default profile exists, the outlook profile is not the default or the default profile is incorrectly configured, ; setup a new profile for the user If $DefaultProfile='' OR NOT KeyExist($ProfileLocation+$DefaultProfile) OR NOT InStr(ReadValue($ProfileLocation+$DefaultProfile+'\13dbb0c8aa05101a9bb000aa002fc45a','001e3001'),$LastName)
; Copy the default profile to the temporary directory Copy $ExePath+'\Outlook\Custom.PRF' $temp $CustomProfile = $temp+'\Custom.PRF' If $HomeDrive='' $HomeDrive='U:' EndIf ; Profile name $=WriteProfileString($CustomProfile,'General','ProfileName','@USERID') ; Auto archive file $=WriteProfileString($CustomProfile,'General','AutoArchiveFile',$HomeDrive+'\@USERID.pst') ; Auto archive file $=WriteProfileString($CustomProfile,'Service1','AutoArchiveFile',$HomeDrive+'\@USERID.pst') ; Mail box name $=WriteProfileString($CustomProfile,'Service1','MailBoxName','@USERID') ; Mail box name $=WriteProfileString($CustomProfile,'Service2','MailBoxName','@USERID') ; Exchange server $=WriteProfileString($CustomProfile,'Service2','HomeServer',$ExchangeServer) ; Personal folder location If $MapPref='Yes' $=WriteProfileString($CustomProfile,'Service3','PathToPersonalFolders',$HomeDrive+'\@USERID.PST') Else $=WriteProfileString($CustomProfile,'Service3','PathToPersonalFolders',$Temp+'\@USERID.PST') EndIf
$OfficeLM = 'HKLM\Software\Microsoft\Office' $OfficeCU = 'HKCU\Software\Microsoft\Office'
; Process Company Name $=WriteValue($OfficeCU+'\'+$Vers+'\Common\UserInfo','Company',Str2Hex($Company),'REG_BINARY') ; Process FullName $=WriteValue($OfficeCU+'\'+$Vers+'\Common\UserInfo','UserName',Str2Hex(@FULLNAME),'REG_BINARY') ; Process Initials $=WriteValue($OfficeCU+'\'+$Vers+'\Common\UserInfo','UserInitials',Str2Hex(SubStr($FirstName,1,1)),'REG_BINARY')
Select ; If it is Outlook 98 or Outlook 2000, configure the following keys and values (e.g. 9.0.0.2416) Case $Vers='8.0' OR $Vers = '9.0' ; Generate the Inbox ; If you use RUN instead of SHELL, the script will pause and not complete properly Shell $ExePath+'\Outlook\Profgen.exe '+$ExePath+'\Outlook\NEWPROF.EXE -P '+$CustomProfile+' -X -R' ; Create default profile $=WriteValue($ProfileLocation,'DefaultProfile', @USERID, 'REG_SZ') ; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated If $DeleteItems = 'Yes' $=WriteValue($ProfileLocation+@USERID+'\0a0d020000000000c000000000000046','000b0115','0100','REG_BINARY') EndIf ; Set the Machine Name $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','Machine Name','@WKSta','REG_SZ') ; Check Internet E-Mail Accounts $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','CheckInternetAccounts','1','REG_DWORD') ; Has Outlook been Setup? $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','FirstRunDialog','False','REG_SZ') ; Primary Client? $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Setup','PrimaryClient','1','REG_DWORD') ; Corporate or POP3? - Needs to be a machine setting $=WriteValue($OfficeLM+'\'+$Vers+'\Outlook\Setup','MailSupport','0','REG_DWORD') ; Corporate or POP3? - Needs to be a machine setting $=WriteValue($OfficeLM+'\'+$Vers+'\Outlook\Setup','First-Run','df83b12adc9cd511b57c0002a57ce19c','REG_BINARY') ; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Mail','EditorPreference','131072','REG_DWORD') $=WriteValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\'+@USERID+'\0a0d020000000000c000000000000046','001e0360','','REG_SZ') ; Changes the view to get rid of the Outlook Bar and show the 'Explorer View' $Expview = '010000002c0000000200000003000000ffffffffffffffffffffffffffffffff62000000270000003c030000ac02000001000000000000000100000000000000c00000006400000003000000' $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Office Explorer','Frame',$Expview,'REG_BINARY') ; Set the default Font to be Verdana 10 pt $PlTextFont = '3c0000000f0000e800000040c80000000600000000000000002056657264616e61000200000000000000000000000000201a493a38e9070001000000' $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Preferences','PlainTextFont',$PlTextFont,'REG_BINARY') ; If it is Outlook 2002 or 2003, configure the following keys and values Case $Vers = '10.0' OR $Vers='11.0' ; No extra EXEs or files other than the PRF needed for Outlook 2002 or 2003 ; This is discussed at: http://www.slipstick.com/outlook/ol2002/prftips.htm $=WriteProfileString($CustomProfile,'General','BackupProfile','NO')
; This is discussed at the bottom of - http://www.microsoft.com/office/ork/xp/four/outc03.htm $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Setup','ImportPRF',$CustomProfile,'REG_SZ') $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook','Machine Name','@WKSTA','REG_SZ') $=DelValue($OfficeCU+'\'+$Vers+'\Outlook\Setup','First-run') ; Import the profile for outlook Run $OutlookExe+' /importprf '+$CustomProfile Sleep 1
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Mail','EditorPreference','131072','REG_DWORD') ; Set the default mail editor to word $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Mail','UseWordMail','0','REG_DWORD') ; Set the default Font to be Verdana 10 pt $PlTextFont = '3c0000000f0000e800000040c80000000600000000000000002056657264616e61000200000000000000000000000000201a493a38e9070001000000' $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Preferences','TextFontSimple',$PlTextFont,'REG_BINARY') ; Changes the view to get rid of the Outlook Bar and show the 'Explorer View' $Expview = '010000002c0000000200000003000000ffffffffffffffffffffffffffffffff2c0000002c00000084020000dc01000001000000000000000100000000000000c0000000640000001800000003000000' $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY') ; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated If $DeleteItems = 'Yes' $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Preferences','EmptyTrash','1','REG_DWORD') EndIf ; Enable spell check before sending $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\Options\Spelling','Check',1,'REG_DWORD') ; Disable Instant Messaging $=WriteValue($OfficeCU+'\'+$Vers+'\Outlook\IM','Enabled','0','REG_DWORD')
EndSelect EndIf
Return
Function Str2Hex($InputString) For $x = 1 to Len($InputString) $Str2Hex=$Str2Hex+DecToHex(Asc(SubStr($InputString,$x,1)))+'00' Next $Str2Hex=$Str2Hex+'0000' EndFunction
|
|
Top
|
|
|
|
#106602 - 2003-11-06 02:11 PM
Re: Outlook 2002
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Richard,
Couple of things -
We should be able to trim down those long lines.
Your code is a bit of a challenge to read.
Maybe it is time to go back a look at the FAQ again? I had worked with a guy on this and I think some of the settings that we are "hacking" in can be addressed with the PRF file.
Outlook/Exchange Configuration - KiX 3.63+ required
The version 4.x breaks this up pretty good into functions as well.
Notice it was updated in July. I did quite a bit of work with Anthony Harper then.
Taking your code, I did some clean up and added some comments to it (You may want to look at the FAQ again: Code Re-Write as it has some cleaned up code and uses more functions too):
code:
:outlook $company='CSIRO' ; Do you want users to delete all deleted items on Exit from Outlook? $deleteitems = 'Yes' ; Is it Winnt or 2K? IF @inwin=1 ; Windows NT Registry Locations $profilelocation='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\' ELSE ; Windows 9x Registry Locations $profilelocation='HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles\' ENDIF
$outlookexe=ReadValue('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\Outlook.EXE','') ; Get version of executable for MS-Outlook $outlookversion=GetFileVersion($outlookexe) $vers=SubStr($outlookversion,1,InStr($outlookversion,'.')+1)
$defaultprofile=ReadValue($profilelocation,'DefaultProfile')
; If no default profile exists, the outlook profile is not the default or the default profile is incorrectly configured, ; setup a new profile for the user IF $defaultprofile='' OR NOT KeyExist($profilelocation+$defaultprofile) OR NOT InStr(ReadValue($profilelocation+$defaultprofile+'\13dbb0c8aa05101a9bb000aa002fc45a','001e3001'),$lastname)
; Copy the default profile to the temporary directory COPY $exepath+'\Outlook\Custom.PRF' $temp $customprofile = $temp+'\Custom.PRF' IF $homedrive='' $homedrive='U:' ENDIF ; Profile name $=WriteProfileString($customprofile,'General','ProfileName',@userid) ; Auto archive file $=WriteProfileString($customprofile,'General','AutoArchiveFile',$homedrive+'\'+@userid+'.pst') ; Auto archive file $=WriteProfileString($customprofile,'Service1','AutoArchiveFile',$homedrive+'\'+@userid+'.pst') ; Mail box name $=WriteProfileString($customprofile,'Service1','MailBoxName',@userid) IF $deleteitems='YES' IF 'TRUE'<>ReadProfileString($prffile,'Service1','EmptyWastebasket') $rc=WriteProfileString($prffile,'Service1','EmptyWastebasket','TRUE') ENDIF ELSE IF 'FALSE'<>ReadProfileString($prffile,'Service1','EmptyWastebasket') $rc=WriteProfileString($prffile,'Service1','EmptyWastebasket','FALSE') ENDIF ENDIF ; Mail box name $=WriteProfileString($customprofile,'Service2','MailBoxName',@userid) ; Exchange server $=WriteProfileString($customprofile,'Service2','HomeServer',$exchangeserver) ; Personal folder location IF $mappref='Yes' $=WriteProfileString($customprofile,'Service3','PathToPersonalFolders',$homedrive+'\'+@userid+'.PST') ELSE $=WriteProfileString($customprofile,'Service3','PathToPersonalFolders',$temp+'\'+@userid+'.PST') ENDIF
$officelm = 'HKLM\Software\Microsoft\Office' $officecu = 'HKCU\Software\Microsoft\Office'
; Process Company Name $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','Company',Str2Hex($company),'REG_BINARY') ; Process FullName $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','UserName',Str2Hex(@fullname),'REG_BINARY') ; Process Initials $=WriteValue($officecu+'\'+$vers+'\Common\UserInfo','UserInitials',Str2Hex(SubStr($firstname,1,1)),'REG_BINARY')
SELECT ; If it is Outlook 98 or Outlook 2000, configure the following keys and values (e.g. 9.0.0.2416) CASE $vers='8.0' OR $vers = '9.0' ; Generate the Inbox ; If you use RUN instead of SHELL, the script will pause and not complete properly SHELL $exepath+'\Outlook\Profgen.exe '+$exepath+'\Outlook\NEWPROF.EXE -P '+$customprofile+' -X -R' ; Create default profile $=WriteValue($profilelocation,'DefaultProfile', @userid, 'REG_SZ') ; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated IF $deleteitems = 'Yes' $=WriteValue($profilelocation+@userid+'\0a0d020000000000c000000000000046','000b0115','0100','REG_BINARY') ENDIF ; Set the Machine Name $=WriteValue($officecu+'\'+$vers+'\Outlook','Machine Name',@wksta,'REG_SZ') ; Check Internet E-Mail Accounts $=WriteValue($officecu+'\'+$vers+'\Outlook','CheckInternetAccounts',1,'REG_DWORD') ; Has Outlook been Setup? $=WriteValue($officecu+'\'+$vers+'\Outlook','FirstRunDialog','False','REG_SZ') ; Primary Client? $=WriteValue($officecu+'\'+$vers+'\Outlook\Setup','PrimaryClient',1,'REG_DWORD') ;>>> Is this necessary? We are setting up using Profgen anyway ; Corporate or POP3? - Needs to be a machine setting ;$=WriteValue($officelm+'\'+$vers+'\Outlook\Setup','MailSupport',0,'REG_DWORD') ;>>> ; First Run $=WriteValue($officelm+'\'+$vers+'\Outlook\Setup','First-Run','df83b12adc9cd511b57c0002a57ce19c','REG_BINARY') ; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Mail','EditorPreference','131072','REG_DWORD') $=WriteValue($profilelocation+@userid+'\0a0d020000000000c000000000000046','001e0360','','REG_SZ') ; Changes the view to get rid of the Outlook Bar and show the 'Explorer View' ;>>> Trimmed long line $expview='010000002c0000000200000003000000ffffffffffffffffffffffffffffffff' $expview=$expview+'62000000270000003c030000ac02000001000000000000000100000000000000' $expview=$expview+'c00000006400000003000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY') ;>>> ; Set the default Font to be Verdana 10 pt
;>>> Trimmed long line $pltextfont='3c0000000f0000e800000040c80000000600000000000000002056657264616e610002' $pltextfont=$pltextfont+'00000000000000000000000000201a493a38e9070001000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Preferences','PlainTextFont',$pltextfont,'REG_BINARY') ;>>>
CASE ; If it is Outlook 2002 (XP) or 2003, configure the following keys and values $vers = '10.0' OR $vers='11.0' ; No extra EXEs or files other than the PRF needed for Outlook 2002 or 2003 ; This is discussed at: http://www.slipstick.com/outlook/ol2002/prftips.htm $=WriteProfileString($customprofile,'General','BackupProfile','NO')
; This is discussed at the bottom of - http://www.microsoft.com/office/ork/xp/four/outc03.htm $=WriteValue($officecu+'\'+$vers+'\Outlook\Setup','ImportPRF',$customprofile,'REG_SZ') $=WriteValue($officecu+'\'+$vers+'\Outlook','Machine Name',@wksta,'REG_SZ') $=DelValue($officecu+'\'+$vers+'\Outlook\Setup','First-run')
;>>>
; Import the profile for outlook ;RUN $outlookexe+' /importprf '+$customprofile >> You should not need to run outlook ;SLEEP 1
;>>>
; Set the default mail preference as Rich Text format 196609 is Word, 199610 Rich Text Format $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Mail','EditorPreference','131072','REG_DWORD') ; Set the default mail editor to word $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Mail','UseWordMail','0','REG_DWORD') ; Set the default Font to be Verdana 10 pt ;>>> Trimmed long line $pltextfont='3c0000000f0000e800000040c80000000600000000000000002056657264616e610002' $pltextfont=$pltextfont+'00000000000000000000000000201a493a38e9070001000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Preferences','TextFontSimple',$pltextfont,'REG_BINARY') ;>>>
;>>>
;This is talked about here ;http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=10&t=000019#000002
;>>>
; Changes the view to get rid of the Outlook Bar and show the 'Explorer View' IF $explorview='Yes' AND $vers='10.0' ;Don't change version 11 $expview='010000002c0000000200000003000000ffffffffffffffffffffffffffffffff2c0000002c00000084020000dc' $expview=$expview+'01000001000000000000000100000000000000c0000000640000001800000003000000' $=WriteValue($officecu+'\'+$vers+'\Outlook\Office Explorer','Frame',$expview,'REG_BINARY') ENDIF ; Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated
;>>>
;This is talked about here ;http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=10&t=000019#000002 ;>>>
;IF $deleteitems = 'Yes' $=WriteValue($officecu+'\'+$vers+'\Outlook\Preferences','EmptyTrash','1','REG_DWORD') ;ENDIF ; Enable spell check before sending - thanks Richard! $=WriteValue($officecu+'\'+$vers+'\Outlook\Options\Spelling','Check',1,'REG_DWORD') ; Disable Instant Messaging - thanks Richard! $=WriteValue($officecu+'\'+$vers+'\Outlook\IM','Enabled',0,'REG_DWORD') ENDSELECT ENDIF
RETURN
FUNCTION Str2Hex($inputstring) FOR $x = 1 TO Len($inputstring) $str2hex=$str2hex+DecToHex(Asc(SubStr($inputstring,$x,1)))+'00' NEXT $str2hex=$str2hex+'0000' ENDFUNCTION
Thanks,
Kent [ 06. November 2003, 14:44: Message edited by: kdyer ]
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1376 anonymous users online.
|
|
|