(3) In the script below, change <YOUR EXCHANGE SERVER> to 'EXCHANGESERVER' or what it's name is.
(4) From the KIXTART.KIX or your login script, simply start this script by using:
outlook
Now, let's get into the main code.
Code:
; -- OUTLOOK - ALL - MAIN CONFIGURATION FOR MICROSOFT OUTLOOK TO EXCHANGE SERVERS
; Function OUTLOOK()
;
; Author Kent Dyer (leptonator@hotmail.com
;
; Contributors Lonkero
; Matt "EvilHearted"
; Rad
; Anthony Harper
; mistajon (thanks for Outlook 2007 fix!)
;
; Action Configure Outlook
;
; Syntax OUTLOOK
;
; Version 1.20
;
; Date 1-April-2001
;
; Date Revised 11-March-2008
;
;
; Update Notes 11-March-2008 Remove Outlook 2000 and Window 9x
; Fixes $serverloc variable
; 18-Jan-2008 Added support for Outlook 2007 (version 12)
;
; Parameters none
;
; Remarks This function is used to configure Outlook with Exchange Server,
; Change 'MAILSVR' to your server name
;
; Returns Nothing
;
; Dependencies Outlook.prf
; http://www.microsoft.com/office/ork/2000/download/Outlook.prf
; http://download.microsoft.com/download/f/6/e/f6e04362-83d7-4107-be59-91e0658fa198/outlook.prf
;
; KiXtart Ver 4.02
;
; Example(s) OUTLOOK
FUNCTION OUTLOOK()
DIM $prfrem,$waste,$editorpref,$prf,$serverloc,
$exchgsvr,$prfloc,$prffile,$ppru,$exe,$ver,$idx,$keyname,$rc,
$outlook,$ns,$unread,$fldr,$x,$regexp,$MSOdir
$waste='FALSE' ; If set to TRUE, Empty Outlooks Deleted Items Folder on Exit
$editorpref=30001 ; Editor Preference 10001=Plain Text, 20001=HTML, and 30001=Rich Text
$prf='Outlook.prf'
$prffile='%temp%\'+$prf
$serverloc=@LSERVER+'\netlogon\Profgen' ; Outlook .PRF location
$exchgsvr='MAILSVR' ; Main Exchange Server Location
$prfloc='HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles'
; -- Current User Profile
$ppru=$prfloc+'\'+@USERID
; -- Determine version of Outlook
$exe=ReadValue('HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE','')
$ver=SPLIT(GetFileVersion($exe),'.')[0]+'.0'
; -- Determine location of Office
$MSOdir=SUBSTR($exe,1,Len($exe)-11)
; -- This is used for when you have people come into the company from another Exchange Server into yours
; -- This is an Optional section
;IF INGROUP('GROUPNAME') AND READVALUE($ppru+'\13dbb0c8aa05101a9bb000aa002fc45a','001e6602')<>$exchgsvr
; $rc=WriteValue($ppru+'\13dbb0c8aa05101a9bb000aa002fc45a','001e6602',$exchgsvr,'REG_SZ')
; $rc=WriteValue($ppru+'\13dbb0c8aa05101a9bb000aa002fc45a','001e6608',$exchgsvr,'REG_SZ')
;ENDIF
; -- Look for Outlook Profile
IF (ReadValue($prfloc,'DefaultProfile')<>@USERID AND NOT INSTR(ReadValue($prfloc,'DefaultProfile'),'MS Exchange')) OR @ERROR
COPY $serverloc+'\'+$prf $prffile
$rc=WriteProfileString($prffile,'General','ProfileName',@USERID)
$rc=WriteProfileString($prffile,'General','DefaultProfile','Yes')
$rc=WriteProfileString($prffile,'General','OverwriteProfile','Yes')
$rc=WriteProfileString($prffile,'General','BackupProfile','No')
$rc=WriteProfileString($prffile,'Service1','AutoNameCheck','TRUE')
$rc=WriteProfileString($prffile,'Service1','EmptyWastebasket',$waste)
$rc=WriteProfileString($prffile,'Service1','CloseOriginalMessage','TRUE')
$rc=WriteProfileString($prffile,'Service2','HomeServer',$exchgsvr)
$rc=WriteProfileString($prffile,'Service2','MailboxName',@USERID)
;If Needed, you may want to uncomment the next line
;$ver='10.0' OR $ver='11.0' OR $ver='12.0';(e.g. 10.0.2627.1)
$rc=DelValue('HKCU\Software\Microsoft\Office\'+$ver+'\Outlook\Setup','First-Run')
$rc=WriteValue('HKCU\Software\Microsoft\Office\'+$ver+'\Outlook\Setup','ImportPRF',$prffile,'REG_SZ')
IF $ver='10.0'
$rc=WriteValue('HKCU\Software\Microsoft\Office\'+$ver+'\Outlook\IM','Enabled',0,'REG_DWORD')
ENDIF
; -- This was added as we needed to generate Outlook Profiles in a Citrix Session - thanks Rad!
$outlook=CreateObject('Outlook.Application')
$ns=$outlook.getnamespace('MAPI')
$fldr=$ns.getdefaultfolder(6)
$unread=$fldr.unreaditemcount
$outlook=0
DEL $MSOdir+'welcome.msg'
ENDIF
ENDFUNCTION
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Documentation for -
Outlook 98/2000/XP Configuration By: Kent Dyer Version - 1.16
Updated 10-June-2006 Tested with KiXtart - 4.02, 4.2x, 4.5x Removed Support for 3.x Test Environments - Win95, NT 4.0, W2k, WXP Tested with - Outlook 98, 2000, XP (2002), 2003 Used some ideas from MCA's KIXnnnUPDATE.EXE script Visit: http://home.wanadoo.nl/scripting/
the key "EditorPreference" I believe is for each editor. As far as I know the values are as follows (in Hex).
10001 = Plain Text 30001 = Rich Text 20001 = HTML
Therefore just change this key from any 20001's to 10001. This won't require local admin rights. How do I use Word, or Outlook's Editor? Make the following change in the Registry..
Quote:
; -- Set the default mail preference as Rich Text format 196609 is Word, 196610 Rich Text Format IF "196610" <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail","EditorPreference") $rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail","EditorPreference","196610","REG_DWORD") ENDIF Originally created 15-August-2001 http://kixtart.org/board/ultimatebb.php?ubb=get_topic;f=10;t=000019 This completes the setup of Outlook Yes, you can use PROFGEN and FIXPRF, but these alone don't complete the setup They are, however necessary to complete this piece of the script {Edit - Removed the need for FIXPRF.EXE}
Simplified vs. Full Version The simplified version just "gets the job done." The Full verson does some common configuration settings like an: "Explorer-type view", Editor, Font, etc. Primary focus of the "Full version" was Outlook 2000.
Key points:
Changes the view to get rid of the Outlook Bar and show the "Explorer View" Now selectable.
Checks the box to empty deleted items on leaving Outlook. Now selectable.
Deletes bogus profiles like OEM User, etc. Now selectable.
Sets the default font to "Verdana 10 pt" and editor to be Rich Text. Now selectable - part of Explorer View.
Changes Necessary:Make the following changes as needed:
Company key needs to be changed to yours ($CompanyStr) - It can be removed from the script....
Quote: I too ran into this problem today and was unable to find a solution documented anywhere. As I guess, I added the line "BackupProfile=No" in the Section 1, [General] section and it works! Give it a try. It sure would be nice if there was documentation for the new .prf file format in Outlook 2002!
$regKey='HKCU\Software\Microsoft\Office\Outlook\OMI Account Manager'
$Entry = ReadValue($regKey,'Default Mail Account')
$rc=WriteValue($regKey+'\Accounts\'+$ENTRY,'SMTP Server','xxx.xxx.xxx.xxx','REG_SZ')
$rc=WriteValue($regKey+'Accounts\'+$ENTRY,'POP3 Server','xxx.xxx.xxx.xxx','REG_SZ')
$rc=WriteValue($regKey+'\Accounts\'+$ENTRY,'Leave Mail On Server',1,'REG_DWORD')
$rc=WriteValue($regKey+'\Accounts\'+$ENTRY,'Remove When Deleted',1,'REG_DWORD')
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Simplified Outlook 12 (2007) detection wit the following code:
Code:
$ver>='10.0';(e.g. 10.0.2627.1) < Note: added for OL2007
;If Needed, you may want to uncomment the next line
;$ver='10.0' OR $ver='11.0' OR $ver='12.0';(e.g. 10.0.2627.1)