Page 1 of 1 1
Topic Options
#189743 - 2008-09-18 11:13 PM Automatic Config Outlook 2007
BFlevo Offline
Just in Town

Registered: 2008-09-18
Posts: 2
Dear all,

I have used the default script of KDyer for a new TS server with 2003 server and Office 2007 SP1. I have set up a lot of servers like this but this is the first time with office 2007.

The outlook prf file is located in the netlogon dir like the scripts. The rest of the script is running without any problems.

If somebody can take look at the script and the PRF it would be appreciated:
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\' ; Outlook .PRF location
$exchgsvr='BRA01' ; 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
$rc=WriteValue('HKCU\Software\Microsoft\Office\Common','QMEnable',0,'REG_DWORD') ; -- Turn off User Feedback
; -- 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' ; -- Delete welcome message
ENDIF
ENDFUNCTION


PRF File:
;Automatically generated PRF file from the Microsoft Office Customization and Installation Wizard

; **************************************************************
; Section 1 - Profile Defaults
; **************************************************************

[General]
Custom=1
ProfileName=outlook
DefaultProfile=Yes
OverwriteProfile=Yes
ModifyDefaultProfileIfPresent=FALSE

; **************************************************************
; Section 2 - Services in Profile
; **************************************************************

[Service List]
Service1=Outlook Address Book
Service2=Microsoft Exchange Server
ServiceEGS=Exchange Global Section
;ServiceX=Microsoft Outlook Client

;***************************************************************
; Section 3 - List of internet accounts
;***************************************************************

[Internet Account List]

;***************************************************************
; Section 4 - Default values for each service.
;***************************************************************

[Service1]
OverwriteExistingService=No
UniqueService=Yes
MailboxName=%UserName%
HomeServer=BRA01
AccountName=Microsoft Exchange Server

[ServiceEGS]
MailboxName=%UserName%
HomeServer=BRA01
;***************************************************************
; Section 5 - Values for each internet account.
;***************************************************************

Top
#189745 - 2008-09-19 05:45 AM Re: Automatic Config Outlook 2007 [Re: BFlevo]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I will look into this for you.

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#189746 - 2008-09-19 06:27 AM Re: Automatic Config Outlook 2007 [Re: Kdyer]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Looked at the code and what you are trying to accomplish. Unfortunately, I don't have Office 2007. It seems with the generated PRF file, you don't need much of that section of the KiX code. If you want, you can remove or uncomment the commented out lines that modify the PRF file.

Please let me know if this works for you:
 Code:
BREAK ON
CLS

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\' ; Outlook .PRF location
 $exchgsvr='BRA01' ; 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 you are running a generated profile, you may not need these entries
   ; $rc=WriteProfileString($prffile,'Service1','MailboxName',@USERID)
   ; $rc=WriteProfileString($prffile,'ServiceEGS','MailboxName',@USERID)
   ; $rc=WriteProfileString($prffile,'ServiceEGS','HomeServer',$exchgsvr)

   ;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
   $rc=WriteValue('HKCU\Software\Microsoft\Office\Common','QMEnable',0,'REG_DWORD') ; -- Turn off User Feedback
   ; -- 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' ; -- Delete welcome message
ENDIF
ENDFUNCTION


HTH,

Kent


Edited by Kdyer (2008-09-19 06:28 AM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#189749 - 2008-09-19 10:04 AM Re: Automatic Config Outlook 2007 [Re: Kdyer]
BFlevo Offline
Just in Town

Registered: 2008-09-18
Posts: 2
It worked.

Thnx

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.053 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org