Page 1 of 2 12>
Topic Options
#70807 - 2002-10-14 10:23 AM Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
Hi there!!

Im new to this forum but not new to kix [Wink] .
I have some problem with the exchange/outlook configuration script.

I would like to know what each step do and how its suppossed to work

Like I see it it the script copies files then removes them at once but later in the script it is supposed to use the files from $windir.....

could someone please help me with this script.

Im gonna use it in w2k ad with mixed clients (9x/w2kp/nt)

/regards Matt

Top
#70808 - 2002-10-14 10:28 AM Re: Problem with kdyers outlook script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeh, not new to kix...

who knows. I show you something simple:
code:
       IF 1 <> EXIST($windir+"\Outlook.PRF")
COPY @ldrive+"PROFGEN\RBMG\Outlook2000\Outlook.PRF" $windir
ENDIF
IF 1 <> EXIST ($windir+"\Profgen.exe")
COPY @ldrive+"PROFGEN\RBMG\Outlook2000\Profgen.exe" $windir
ENDIF
IF 1 <> EXIST ($windir+"\NEWPROF.EXE")
COPY @ldrive+"PROFGEN\RBMG\Outlook2000\NEWPROF.EXE" $windir
ENDIF
IF EXIST ($windir+"\FixPrf.EXE")
DEL $windir+"\FixPrf.EXE"
ENDIF
IF EXIST($systemdrive+"PROFGEN.exe")
DEL $systemdrive+"PROFGEN.EXE"
ENDIF
IF EXIST($systemdrive+"NEWPROF.EXE")
DEL $systemdrive+"NEWPROF.EXE"
ENDIF

now, take a close look about what files are copied and deleted. also, to where and from where.

just a little patience and it's there.

if someone wonders what is this, the script is at:
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=003683#000000

[ 14. October 2002, 10:33: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#70809 - 2002-10-14 02:13 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Matt,

First of all.. Welcome to the board!

Second, it is good to see that there are people using my code..

If you are concerned with the script, you can do the "full-fledged" or the trimmed down version.. But, the thing is that you run the script like -

code:
kix32 outlook /d

Or, add a DEBUG ON in the script..

This information has also been updated in the FAQ Section and specifically, Exchange/Outlook Configuration.

Now, back to your question..

> Files deleted and then used..

If we look at:
code:
       IF 1 <> EXIST($windir+"\Outlook.PRF")
COPY @ldrive+"PROFGEN\Outlook2000\Outlook.PRF" $windir
ENDIF
IF 1 <> EXIST ($windir+"\Profgen.exe")
COPY @ldrive+"PROFGEN\Outlook2000\Profgen.exe" $windir
ENDIF
IF 1 <> EXIST ($windir+"\NEWPROF.EXE")
COPY @ldrive+"PROFGEN\Outlook2000\NEWPROF.EXE" $windir
ENDIF
IF EXIST ($windir+"\FixPrf.EXE")
DEL $windir+"\FixPrf.EXE"
ENDIF
IF EXIST($systemdrive+"PROFGEN.exe")
DEL $systemdrive+"PROFGEN.EXE"
ENDIF
IF EXIST($systemdrive+"NEWPROF.EXE")
DEL $systemdrive+"NEWPROF.EXE"
ENDIF

Specifcally, the DEL commands..

DEL $windir+"\FixPrf.EXE" >> Not Used
DEL $systemdrive+"PROFGEN.EXE" >> We don't use this in the C:\ root anymore but from %windir%
DEL $systemdrive+"NEWPROF.EXE" >> We don't use this in the C:\ root anymore but from %windir%

I have also made some changes to this to look for not only the @userid profile, but the "MS Exchange Settings" profile too. The reason being, is that we have a number of people that have off-line e-mail and once you re-generate their inbox, you have to manually re-map the off-line folders.

I will put this updated version up later on today..

HTH,

Kent

[ 14. October 2002, 14:17: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#70810 - 2002-10-14 02:58 PM Re: Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
Gr8 thx for the answer got but can anyone explain this, I got it to work in w2kp but in w9x i get a error messege when the profgen.exe executes

"the file profgen.exe is linked to export netapi32.dll:NetApiBufferFree, that doesent exist"

Any Ideas??

//Matt

Top
#70811 - 2002-10-14 03:05 PM Re: Problem with kdyers outlook script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mmm...
ie version?
_________________________
!

download KiXnet

Top
#70812 - 2002-10-14 03:44 PM Re: Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
IE 5

//Matt

Top
#70813 - 2002-10-14 04:03 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Matt,

What version of Outlook are we working with here?

Thanks!

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

Top
#70814 - 2002-10-14 04:10 PM Re: Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
Outlook 2000, should it be 98?
tried to install IE6 without success.

//Matt

Top
#70815 - 2002-10-14 04:22 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Looks like we may have to look at the OUTLOOK.PRF file as NETAPI32.DLL is related to WMI and specifically - NetWkstaUserGetInfo

http://eric.aling.tripod.com/PB/netapi.htm

HTH,

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

Top
#70816 - 2002-10-14 04:24 PM Re: Problem with kdyers outlook script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
It will most likely mean that Windows 95 is way too old to be supported by PROFGEN.EXE because of old DLL versions. And since Windows 9x is no longer supported by Microsoft, you should rather upgrade to one of the still supported Microsoft operating systems.
_________________________
There are two types of vessels, submarines and targets.

Top
#70817 - 2002-10-14 04:45 PM Re: Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
I cant find "NetWkstaUserGetInfo" anywere.
I wish we had all w2kp clients but we dont have the time to upgrade.
1500 users on 40 different locations and no WAN has been delivered yet, the new mail server must be up and running before 1 january 2003.... pretty stressed out

Top
#70818 - 2002-10-14 04:46 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Can you post your OUTLOOK.PRF? We maybe able to do this another way.

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

Top
#70819 - 2002-10-14 04:56 PM Re: Problem with kdyers outlook script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
EvilHearted,
You said "we dont have the time to upgrade".

I read somewhere "If you don't have the time to do the job right in the first place, where will you find the time to do it over?"

At my work, we have a simple rule. Since Wintendo is unsupported, no new applications will be rolled out to them. They either go on unsupprted, frozen in time or the get scrubbed and Win2k installed. It takes only about 20 minutes for the average build to be dropped to a machine. One cannot afford to get bogged down in supporting legacy OS.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70820 - 2002-10-15 08:20 AM Re: Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
Heres my .prf file

thanx for the help so far kdyer

//Matt

; Outlook PRF file for Exchange Server users
; -------------------------------------------
; Copyright (C), Microsoft Corporation, 1996.
;
; The following PRF file is included as an example of how to create a PRF file that will
; configure Outlook users with Exchange Server. Section 1, 2, and 3 may be modified.
; DO NOT MODIFY SECTION 4. It will most likely cause Exchange services to crash.
; Be very careful when editing to ensure property values match their property types.
; NOTE: The HomeServer setting for the Microsoft Exchange Server must be filled in
; before using this file.
;
; For information about how to disable Outlook Profile Setup and instead use the
; the Inbox Setup Wizard, see NONE.PRF in the Office Resource Kit.

; ************************************************************************
; Section 1 - Profile defaults.

[General]
Custom=1
; -- Required. Indicates that this is a customized PRF file.
ProfileName=%username%
DefaultProfile=Yes
OverwriteProfile=Yes
DefaultStore=Service2

; ************************************************************************
; Section 2 - Services in profile.

[Service List]
Service1=Microsoft Outlook Client
Service2=Microsoft Exchange Server
Service3=Outlook Address Book
Service4=Personal Address Book
Service5=Archived Messages

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

[Service1]
EmptyWastebasket=TRUE
SelectEntireWord=TRUE
AfterMoveMessage=2
CloseOriginalMessage=FALSE
GenReadReceipt=FALSE
GenDeliveryReceipt=FALSE
DefaultSensitivity=0
DefaultPriority=1
SaveSentMail=TRUE

; **** Customized Outlook Client properties ****
CloseOriginalMsg=1
AllowCommaAsSeparator=1
MarkMyComments=0
AutoArchiveInterval=5
DefaultArchiveFile=H:\Outlook\%username%.pst

[Service2]
ConversionProhibited=TRUE
MailboxName=%username%
HomeServer=lab1
; Required.
; -- The name of the Microsoft Exchange Server the user should
; connect to (ex: ALEX). You can specify any Microsoft Exchange Server
; in your site, and the correct Home Server will be assigned
; when the user first logs on.

[Service3]
Ben=TRUE
; -- Dummy property. Do not delete or modify.

[Service4]
PathToPersonalAddressBook="H:\Outlook\%username%.pab"
ViewOrder=1

[Service5]
PathToPersonalFolders="H:\Outlook\%username%.pst"
RememberPassword=TRUE
EncryptionType=0x40000000
Password=

; ************************************************************************
; Section 4 - Mapping for profile properties. DO NOT MODIFY.

; ************************************************************************
; Microsoft Outlook Client definitions

[Microsoft Outlook Client]
SectionGUID=0a0d020000000000c000000000000046

EmptyWastebasket=PT_BOOLEAN,0x0115
; -- A boolean value indicating whether or not to empty the
; wastebasket on exit.

SelectEntireWord=PT_BOOLEAN,0x0118
; -- A boolean value indicating whether or not to select entire
; words when selecting.

AfterMoveMessage=PT_LONG,0x013B
; -- Indicates what to do after moving or deleting a message.
; Possible values are shown below:
; 0 - Open Next Message
; 1 - Return to Viewer
; 2 - Open Previous Message

CloseOriginalMessage=PT_BOOLEAN,0x0132
; -- A boolean value indicating whether or not to close the
; original message after replying.

GenReadReceipt=PT_BOOLEAN,0x0141
; -- A boolean value indicating whether or not to generate
; a read receipt on sent mail.

GenDeliveryReceipt=PT_BOOLEAN,0x014C
; -- A boolean value indicating whether or not to generate
; a delivery receipt on sent mail.

DefaultSensitivity=PT_LONG,0x014F
; -- The default sensitivity to send mail with.
; Possible values are shown below:
; 0 - Normal
; 1 - Personal
; 2 - Private
; 3 - Confidential

DefaultPriority=PT_LONG,0x0140
; -- The default priority to send mail with.
; Possible values are shown below:
; 0 - Low
; 1 - Normal
; 2 - High

SaveSentMail=PT_BOOLEAN,0x0142
; -- A boolean value indicating whether to save a copy of
; sent messages in the sent items folder.

; **** Custom entries added by rickva@microsoft.com ****

CloseOriginalMsg=PT_BOOLEAN,0x0132
; -- A boolean value indicating whether Outlook should close original
; message when replying or forwarding.

MarkMyComments=PT_BOOLEAN,0x0319
; -- A boolean value indicating whether Outlook should mark comments
; in a reply message with the users name.

AllowCommaAsSeparator=PT_BOOLEAN,0x0350
; -- A boolean value indicating whether Outlook should allow a comma
; to be used as an address separator.

AutoArchiveInterval=PT_LONG,0x0323
; -- The default is to auto archive every 14 days.
; Possible values are shown below:
; 1 - 60

DefaultArchiveFile=PT_STRING8,0x0324
; -- The path and file name for the default auto archive file.
; ex: c:\home\rickva\outlook\archive.pst

; ************************************************************************
; Microsoft Exchange Server service definitions.

[Microsoft Exchange Server]
ServiceName=MSEMS
MDBGUID=5494A1C0297F101BA58708002B2A2517

MailboxName=PT_STRING8,0x6607
; -- The name of the user's Exchange Server Mailbox

HomeServer=PT_STRING8,0x6608
; -- The name of the Microsoft Exchange Server the user should
; connect to. You can specify any Microsoft Exchange Server
; in your site, and the correct Home Server will be assigned
; when the user first logs on.

OfflineFolderPath=PT_STRING8,0x6610
; -- The path to the Offline Store File that contains
; local replicas of the user's Mailbox and Favorites.
; If you do not specify a value, no Offline Store will
; be created. If you specify a path, an Offline Store
; will be created and the Inbox, Outbox, Deleted Items,
; and Sent Items folders will be replicated to it.

OfflineAddressBookPath=PT_STRING8,0x660E
; -- The path to the directory to store offline address
; book files in.

ExchangeConfigFlags=PT_LONG,0x6601
; -- Flags that control behavior when connecting to the Exchange
; Server.
; The following values are possible:
; VALUE RESULT
; 4 Normal
; 6 Ask whether to connect or work offline at startup.
; 12 Allow clients to be authenticated via the Internet
; 14 Combination of 6 and 12.

ConversionProhibited=PT_BOOLEAN,0x3A03
; -- A boolean value indicating whether NEWPROF should
; attempt to resolve the Exchange mailbox name at run time.
; If set to TRUE, NEWPROF will copy the name to the profile
; without resolving it.
; If FALSE, the name will be resolved. Invalid server or
; mailbox name will not be copied to the profile.

; ************************************************************************
; Microsoft Mail service definitions.

[Microsoft Mail]
ServiceName=MSFS

; -- The path to the users post office. Mapped network drives, UNC and NETWARE paths
; are acceptable. NETWARE paths of the type NWServer/share:dir\dir1 are converted to
; UNC paths of the type \\NWServer\share\dir\dir1.

ServerPath=PT_STRING8,0x6600

; -- The users mailbox name. eg. in a NET/PO/USER address,
; this is USER. The maximum mailbox name is 10 characters.

Mailbox=PT_STRING8,0x6601

; -- The users mailbox password. The maximum password is 8 characters.

Password=PT_STRING8,0x67f0

; -- A boolean value indicating whether the users password is
; to be remembered in the profile or not. This is useful because
; if the password is remembered the user can bypass the logon prompt
; if his server path, mailbox name and password are all supplied.

RememberPassword=PT_BOOLEAN,0x6606

; -- The connection type. This may be one of CFG_CONN_AUTO, CFG_CONN_LAN,
; CFG_CONN_REMOTE, CFG_CONN_OFFLINE as defined below.
;
; 0x0 -- LAN type connection. Used to connect to the post office using a
; UNC path or pre-existing mapped drive.
; 0x1 -- Dial up connection using Dial-up Networking.
; 0x2 -- Not connected.
; 0x3 -- Automatically detect whether the connection type is LAN or REMOTE.
; This connection type is only available on Win95.

ConnectionType=PT_LONG,0x6603

; -- A boolean value indicating whether session logging
; is on or off.

UseSessionLog=PT_BOOLEAN,0x6604

; -- The path to the session log file.

SessionLogPath=PT_STRING8,0x6605

; -- A boolean value which indicates whether mail in the outbox
; is sent.

EnableUpload=PT_BOOLEAN,0x6620

; -- A boolean value which indicates whether mail in the server
; mailbag is downloaded.

EnableDownload=PT_BOOLEAN,0x6621

; -- A bit array which allows the user to indicate which addresses
; for which the transport is to attempt delivery. This is useful
; in order to allow a user to specify that a transport only handle
; delivery for a subset of the addresses it can really process.
; When multiple transports are installed and the user wants a
; different transport to handle some specific address types they
; can use this bit array to specify that the MSMAIL transport
; only handle a specific set of addresses.
;
; Possible values as defined below include:
;
; 0x00000001 -- Local Post Office and External Post Office address types
; 0x00000002 -- PROFS address types
; 0x00000004 -- SNADS address types
; 0x00000008 -- MCI address types
; 0x00000010 -- X.400 address types
; 0x00000040 -- FAX address types
; 0x00000080 -- MHS address types
; 0x00000100 -- SMTP address types
; 0x00000800 -- OfficeVision address types
; 0x00001000 -- MacMail address types
; 0x000019df -- All of the above address types

UploadMask=PT_LONG,0x6622

; -- A boolean value which indicates whether a netbios notification
; is sent to a recipients transport when mail is delivered to
; their server inbox.

NetBiosNotification=PT_BOOLEAN,0x6623

; -- The polling interval in minutes when the transport
; checks for new mail. 1 <= polling interval <= 9999

NewMailPollInterval=PT_STRING8,0x6624

; -- A boolean value which, if TRUE, only displays the Microsoft Mail Global Address
; list for name selection. The Postoffice list, external post office lists, and gateway
; address lists are not shown.

DisplayGalOnly=PT_BOOLEAN,0x6625

; -- A boolean value which indicates whether the user wants to enable
; headers while working on the LAN. Headers mode allows the user
; to download message headers and selectively choose which mail
; to download.

UseHeadersOnLAN=PT_BOOLEAN,0x6630

; -- A boolean value which indicates whether the user wants to use
; name resolution based on a local copy of the server address book
; rather than the server address book itself.

UseLocalAdressBookOnLAN=PT_BOOLEAN,0x6631

; -- A boolean value which indicates whether EXTERNAL.EXE, a server process, should be used
; to deliver submitted mail messages. This is sometimes useful when mail is running
; on a slow LAN connection.

UseExternalToHelpDeliverOnLAN=PT_BOOLEAN,0x6632

; -- A boolean value which indicates whether the user wants to enable
; headers while working over a slow speed link. Headers mode
; allows the user to download message headers and selectively
; choose which mail to download.

UseHeadersOnRAS=PT_BOOLEAN,0x6640

; -- A boolean value which indicates whether the user wants to use
; name resolution based on a local copy of the server address book
; rather than the server address book itself.

UseLocalAdressBookOnRAS=PT_BOOLEAN,0x6641

; -- A boolean value which indicates whether EXTERNAL.EXE, a server process, should be used
; to deliver submitted mail messages. This speeds up message delivery when mail is
; running on a Dial-up network connection.

UseExternalToHelpDeliverOnRAS=PT_BOOLEAN,0x6639

; -- A boolean value which indicates that a Dial-up Network connection should
; be established when the transport provider starts up.

ConnectOnStartup=PT_BOOLEAN,0x6642

; -- A boolean value which indicates that a Dial-up Network connection should
; be automatically terminated when headers are finished downloading.

DisconnectAfterRetrieveHeaders=PT_BOOLEAN,0x6643

; -- A boolean value which indicates that a Dial-up Network connection should
; be automatically terminated after mail has finished being sent
; received.

DisconnectAfterRetrieveMail=PT_BOOLEAN,0x6644

; -- A boolean value which indicates that a Dial-up Network connection should
; be automatically terminated when the provider is exited.

DisconnectOnExit=PT_BOOLEAN,0x6645

; -- The name of the Dial-up Network profile that the transport will use by
; default to attempt the connection.

DefaultDialupConnectionName=PT_STRING8,0x6646

; -- Number of times to attempt dial for connection.
; 1 <= retry attempts <= 9999

DialupRetryCount=PT_STRING8,0x6648

; -- Delay between retry attempts in seconds.
; 30 <= retry delay <= 9999

DialupRetryDelay=PT_STRING8,0x6649

; ************************************************************************
; Personal Folders service definitions.

[Archived Messages]
ServiceName=MSPST MS

; -- Path to personal folders.

PathToPersonalFolders=PT_STRING8,0x6700

; -- A boolean value that determines if the personal folders password
; should be cached.

RememberPassword=PT_BOOLEAN,0x6701

; -- A value that designates the type of encryption that is used to
; compress the data in the PST:
;
; No Encryption 0x80000000
; Compressable Encryption 0x40000000
; Best Encryption 0x20000000

EncryptionType=PT_LONG,0x6702

; -- PST password.

Password=PT_STRING8,0x6703

; ************************************************************************
; Personal Address Book service definitions.

[Personal Address Book]
ServiceName=MSPST AB

; -- Path to personal address book.

PathToPersonalAddressBook=PT_STRING8,0x6600

; -- Determines if PAB entries are first, last, or last, first.
;
; first last 0
; last, first 1

ViewOrder=PT_LONG,0x6601

; ************************************************************************
; Outlook Address Book service definitions.

[Outlook Address Book]
ServiceName=CONTAB
Ben=PT_STRING8,0x6700
; -- Dummy property. Do not modify.

Top
#70821 - 2002-10-16 12:00 AM Re: Problem with kdyers outlook script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
at first I would remove the copyright...
it might hang it [Wink]
_________________________
!

download KiXnet

Top
#70822 - 2002-10-15 02:19 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Matt,

My bad sorry..

On http://www.jsiinc.com

Go to - JSI Tip 1786. Another way to set %UserName%, %ComputerName%, and %LogonServer% for W9x..

Download - PUTINENV.EXE..

From the Win9x CD-ROM, you can find WINSET.EXE..

Additonally, you can use - tip 0120.

HTH,

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

Top
#70823 - 2002-10-15 04:23 PM Re: Problem with kdyers outlook script
EvilHearted Offline
Fresh Scripter

Registered: 2002-10-14
Posts: 8
I have used the information on
JSI Tip 1786. Another way to set %UserName%, %ComputerName%, and %LogonServer% for W9x..
´
but i still have the problem with profgen

when i map a homedrive with %username% it works fine under w9x when i used the tip 1786

//Matt

Top
#70824 - 2002-10-15 06:05 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
{Edit - Removed the Company Key}
Matt,

Give this a try...

Note the use of FIXPRF..

code:
 ;BREAK ON
;CLS
; -- Outlook 98/2000/XP Configuration
; -- Kent Dyer
; -- Updated 15-October - 2002
; -- Tested with Kixtart - 3.63, 4.10, 4.02
; -- Test Environments - NT 4.0, W2k, WXP
; -- Used some ideas from MCA's KIXnnnUPDATE.EXE script
; -- Visit: http://home.wanadoo.nl/scripting/
; -- Originally created 15-August-2001
; -- http://kixtart.org/board/ultimatebb.php?ubb=get_topic;f=10;t=000021
; -- 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
; -- Key points:
; -- * Changes the view to get rid of the Outlook Bar and show the "Explorer View" (optionally set)
; -- * Checks the box to empty deleted items on leaving Outlook (optionally set)
; -- * Also deletes bogus profiles like OEM User, etc. (optionally set)
; -- Changes Necessary:
; -- >>>> Company key needs to be changed to yours....
; -- Comments and feedback are welcome to - dyerkb@myrealbox.com
; -- 27-August-2001 - Fixed Registry Key problem, CHKEXCHG.EXE - Not required
; -- 17-February-2002 - Added in compatibility for Windows 9x
; -- 12-March-2002 - Added Ability to turn on/off empty deleted items on exit and removal of bogus profiles
; -- 18-July-2002 - Added in the ability to configure Outlook XP, updated Micrsoft Links
; -- 15-August-2002 - Fixed detection problem, 0 = EXISTKEY with an OR Statment bombs on 3.63
; -- 19-August-2002 - Increased testing with EXISTKEY and related changes
; -- 26-September-2002 - "Locked Down" user could not write to %windir%, created a C:\Scripts folder
; -- 03-October-2002 - Added in key to look for "MS Exchange Settings" as well as @userid
; -- 15-October-2002 - Re-Implemented FIXPRF.EXE for PROFILE Generation corrections
; -- 15-October-2002 - FIXPRF.EXE also is needed for generating the profile for Outlook XP as well
; -- 15-October-2002 - Quieted Profgen with a re-direct to nul - "> nul"
; -- 15-October-2002 - Completed Testing with Windows 9x
; -- 15-October-2002 - Use of more variables, changed @ldrive to @lserver for Win9x
; -- 15-October-2002 - Removed the Need for Winset, Putinenv for Windows 9x
; --- **** The following Resources were used in this composition ****
; --- &&&& URLS/Links updated and verified on 03 - October - 2002 &&&& ---
; -- http://www.microsoft.com/office/ork/2000/download/Outlook.prf - sample PRF file
; -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;q182035 - Windows 95 roving users setup
; -- ftp://ftp.microsoft.com/bussys/exchange/exchange-unsup-ed/profgen.zip - Contains PROFGEN.EXE
; -- Automate Outlook Profile Creation Using PRFPATCH:
; -- http://www.microsoft.com/technet/archive/default.asp?url=/TechNet/archive/office/office97/deploy/prfpatch.asp
; -- http://www.microsoft.com/technet/downloads/exe/profile.exe - PRFPATCH.EXE, sample PRF File
; -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q145905 - NEWPROF command-line options
; -- http://www.microsoft.com/office/ork/appa/appa.htm - Microsoft Office 97 Resource Kit Tools and Utilities page
; -- http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTZAK.asp - Zero Administration Kit HomePage
; -- http://www.microsoft.com/ntworkstation/downloads/bin/zak/zak.exe - Download ZAK, Contains FIXPRF.EXE
; -- http://www.microsoft.com/office/ork/xp/journ/adminup.htm#Off2000
; --- **** Outlook XP ****
; -- You can use GPO Editor for deployment of Outlook XP
; -- You should be able to issue the following command line: outlook.exe /importprf \\server1\share\outlook.prf
; -- Ref. http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/office/officexp/reskit/officexp/part5/c18dpou.asp
; -- Look under: "Customizing an Outlook Installation"
; -- Outlook 2002 (Outlook XP) - http://www.slipstick.com/outlook/ol2002.htm
; -- D:\PFILES\COMMON\SYSTEM\MAPI\1033\95\NEWPROF.EXE - Office 2000 CD
; -- D:\PFILES\COMMON\SYSTEM\MAPI\1033\NT\NEWPROF.EXE - Office 2000 CD

; -- Program Settings, change as needed
$profile_remove = "No" ; -- Profiles other than @USERID, like OEM User, MS Exchange Settings, etc. removed
$deleteitems = "No" ; -- Do you want your users to delete all deleted items on Exit from Outlook?
$explorview = "Yes" ; -- Do you want your users to view the "Explorer View" and not the Outlook bar in Outlook?
$serverloc = @lserver+"\Netlogon\Profgen\Outlook2000" ; -- Server Location

; -- Environment variables
$exchangeserver = "EXCHANGESERVER" ; -- Exchange 2000, should go to any Exchange server and re-direct as needed
$prf = "Outlook.prf" ; -- PRF file

IF (@inwin = 1) ; -- Is it Winnt or 2K?
; -- Windows NT Registry Locations
$profilelocation = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
$windir = READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","SystemRoot")
ELSE
; -- Windows 9x Registry Locations
$profilelocation = "HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles"
$windir = READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion","SystemRoot")
ENDIF

$systemdrive = SUBSTR($windir,1,2) ; -- This will show C: or M: or what drive windows is installed on
$scriptdir = $systemdrive+"\Scripts" ; -- Script Directory
$prffile = $scriptdir+"\"+$prf ; -- Shows c:\scripts\outlook.prf, for example
; -- 19-August-2002 - Fixed detection problem, 0 = EXISTKEY with an OR Statment bombs on 3.63
; -- Thanks to MCA for the KixtartnnnUpdate.EXE script for this info
; -- You can find these at - http://home.wanadoo.nl/scripting/
$ppru = $profilelocation+"\"+@userid
; -- 03-October-2002 - Added in key to look for "MS Exchange Settings"
$mses = $profilelocation+"\MS Exchange Settings"
IF (ExistKey($ppru) = 0) OR (ExistKey($mses) = 0)
RETURN ; -- Profile exists and return
ELSE
$exe = ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE","")
$ver = GetFileVersion($exe) ; -- Get version of executable for MS-Outlook
$pos_locat = INSTR($ver, ".") - 1 ; - Look for where the dot is
$verchk = SUBSTR($ver,1,$pos_locat)

; -- Check to insure that the scripts folder is there
; -- 26-September-2002 - Found an issue with "Locked Down" user that could not write to %windir%
IF GETFILEATTR($scriptdir) & 16
ELSE
SHELL "%comspec% /c md "+$scriptdir
ENDIF

; -- Before we begin, let's insure all needed files are in place

;IF 1 <> EXIST($windir+"\Outlook.PRF")
; -- Kent Dyer - 09/26/02 - Copy each time
COPY $serverloc+"\"+$prf $scriptdir
;ENDIF
IF 1 <> EXIST ($scriptdir+"\Profgen.exe")
COPY $serverloc+"\Profgen.exe" $scriptdir
ENDIF
IF 1 <> EXIST ($scriptdir+"\NEWPROF.EXE")
COPY $serverloc+"\NEWPROF.EXE" $scriptdir
ENDIF
IF 1 <> EXIST ($scriptdir+"\FIXPRF.EXE")
COPY $serverloc+"\FIXPRF.EXE" $scriptdir
ENDIF

; -- Depending on the version ($ver) detected above, go to the appropriate process
SELECT
CASE
$verchk = "8" ; -- If it is Outlook 98, configure the following keys and values (e.g. 8.5.5104.0)
IF $profile_remove = "YES" ; -- If it does not exist, delete out any odd-ball Profiles
$index = 0
:loop3
$keyname = ENUMKEY($profilelocation, $index)
IF @error = 0
;? "Name found: $KeyName" ; -- Uncomment for debugging
IF $keyname <> @userid OR $keyname <> "Sales" ; -- Going to check for @userid
$rc = DELTREE($profilelocation+"\"+$keyname)
;$RC = DELKEY($ProfileLocation, $KeyName)
$index = $index + 1
GOTO Loop3
ENDIF
ENDIF
ENDIF
;SHELL "%COMSPEC% /C "+$ScriptDir+"\Fixprf.exe "+$prfFile @userid @userid $ExchangeServer
SHELL "%COMSPEC% /C "+$scriptdir+"\Fixprf.exe "+$prffile+" @userid @userid "+$exchangeserver
SLEEP 1
IF (@inwin = 1) ; -- Is it Winnt or 2K?
SHELL "%COMSPEC% /C "+$systemdrive+"\Scripts\Profgen.exe "+$systemdrive+"\Scripts\Newprof.exe -p "+$prffile+" -N -R -L > nul"
ELSE
; -- Removed Profgen as it kills Windows 9x
SHELL "%COMSPEC% /C "+$systemdrive+"\Scripts\Newprof.exe -p "+$prffile+" -N -R -L > nul"
ENDIF
; -- If you use RUN instead of SHELL, the script will pause and not complete properly
;SHELL "%COMSPEC% /C "+$systemdrive+"\Scripts\Profgen.exe "+$systemdrive+"\Scripts\NEWPROF.EXE -P "+$prfFile+" > nul"
SLEEP 1
$rc = writevalue($profilelocation, "DefaultProfile", @userid, "REG_SZ")
RETURN
CASE
$verchk = "9" ; -- If it is Outlook 2000, configure the following keys and values (e.g. 9.0.0.2416)
IF $profile_remove = "YES" ; -- If it does not exist, delete out any odd-ball Profiles
$index = 0
:loop4
$keyname = ENUMKEY($profilelocation, $index)
IF @error = 0
;? "Name found: $KeyName" ; -- Uncomment for debugging
IF $keyname <> @userid OR $keyname <> "Sales" ; -- Going to check for @userid
$rc = DELTREE($profilelocation+"\"+$keyname)
;$RC = DELKEY($ProfileLocation, $KeyName)
$index = $index + 1
GOTO Loop4
ENDIF
ENDIF
ENDIF
; -- Generate the Inbox
SHELL "%COMSPEC% /C "+$scriptdir+"\Fixprf.exe "+$prffile+" @userid @userid "+$exchangeserver
SLEEP 1
IF (@inwin = 1) ; -- Is it Winnt or 2K?
SHELL "%COMSPEC% /C "+$scriptdir+"\Profgen.exe "+$scriptdir+"\Newprof.exe -p "+$prffile+" -N -R -L > nul"
ELSE
SLEEP 1
; -- Removed Profgen as it kills Windows 9x
SHELL "%COMSPEC% /C "+$scriptdir+"\Newprof.exe -p "+$prffile+" -N -R -L > nul"
ENDIF
; -- If you use RUN instead of SHELL, the script will pause and not complete properly
;SHELL "%COMSPEC% /C "+$ScriptDir+"\Profgen.exe "+$ScriptDir+"\NEWPROF.EXE -P "+$prfFile+" > nul"
; -- Had to add a small pause
SLEEP 1
$rc = writevalue($profilelocation, "DefaultProfile", @userid, "REG_SZ")

; -- Check for the Default profile, if it does not exist, create it
IF @userid <> READVALUE( $profilelocation, "DefaultProfile" )
$rc = WRITEVALUE ($profilelocation, "DefaultProfile", @userid, "REG_SZ")
ENDIF

; -- Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated
; -- Note: $mses should not come into play here as "MS Exchange Settings" would indicate that this mailbox has
; -- already been completed
IF $deleteitems = "Yes"
IF "0100" <> READVALUE($ppru+"\0a0d020000000000c000000000000046","000b0115")
$rc = WRITEVALUE($ppru+"\0a0d020000000000c000000000000046","000b0115","0100","REG_BINARY")
ENDIF
ENDIF

; -- Changes the view to get rid of the Outlook Bar and show the "Explorer View"
IF $explorview = "Yes"

; -- CHECK FOR KEYS AND IF NEED BE, ADD THEM
; --- Check for the right keys
IF 0 <> EXISTKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0")
$rc = ADDKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0")
ENDIF
IF 0 <> EXISTKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Common")
$rc = ADDKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Common")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Preferences")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Preferences")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\UserInfo")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\UserInfo")
ENDIF
IF 0 <> EXISTKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook")
$rc = ADDKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Options\Mail")
ENDIF
IF 0 <> EXISTKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook\Setup")
$rc = ADDKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook\Setup")
ENDIF
IF 0 <> EXISTKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Office Explorer")
$rc = ADDKEY("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Office Explorer")
ENDIF

; -- Set the Machine Name
IF @wksta <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook","Machine Name")
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook","Machine Name",@wksta,"REG_SZ")
ENDIF
; -- Check Internet E-Mail Accounts
IF 1 <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook","CheckInternetAccounts")
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook","CheckInternetAccounts","1","REG_DWORD")
ENDIF
; -- Has Outlook been Setup?
IF "False" <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook","FirstRunDialog")
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook","FirstRunDialog","False","REG_SZ")
ENDIF
; -- Primary Client?
IF 1 <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Setup","PrimaryClient")
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Setup","PrimaryClient","1","REG_DWORD")
ENDIF
; -- Corporate or POP3? - Needs to be a machine setting
IF 1 <> READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook\Setup","MailSupport")
$rc = WRITEVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook\Setup","MailSupport","1","REG_DWORD")
ENDIF
; -- Corporate or POP3? - Needs to be a machine setting
IF 1 <> READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook\Setup","First-Run")
$rc = WRITEVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Office\9.0\Outlook\Setup","First-Run","df83b12adc9cd511b57c0002a57ce19c","REG_BINARY")
ENDIF

; -- Set the default mail preference as Rich Text format 1996609 is Word, 199610 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

$rc = WRITEVALUE("HKEY_CURRENT_USER\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 = "010000002c0000000200000003000000ffffffffffffffffffffffffffffffff62000000270000003"
$expview = $expview + "c030000ac02000001000000000000000100000000000000c00000006400000003000000"
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Office Explorer","Frame",$expview,"REG_BINARY")

; -- Set the default Font to be Verdana 10 pt
$pltextfont = "3c0000000f0000e800000040c80000000600000000000000002056657264616e6100020000000000000000"
$pltextfont = $pltextfont + "0000000000201a493a38e9070001000000"
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Preferences","PlainTextFont",$pltextfont,"REG_BINARY")
ENDIF
RETURN
CASE
$verchk = "10" ; -- If it is Outlook XP, configure the following keys and values

; -- This is discussed at: http://www.slipstick.com/outlook/ol2002/prftips.htm
IF "NO" <> READPROFILESTRING($prffile,"General","BackupProfile")
$rc = WRITEPROFILESTRING($prffile,"General","BackupProfile","NO")
ENDIF

; -- This is discussed at the bottom of - http://www.microsoft.com/office/ork/xp/four/outc03.htm
$rc=WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Setup","ImportPRF",$winntfile,"REG_SZ")

; -- Change the PRF file from %username% to @userid
IF @userid <> READPROFILESTRING($prffile,"General","ProfileName")
$rc = WRITEPROFILESTRING($prffile,"General","ProfileName",@userid)
ENDIF

; -- Fix the Profile
SHELL "%COMSPEC% /C "+$scriptdir+"\Fixprf.exe "+$prffile+" @userid @userid "+$exchangeserver
SLEEP 1
RUN $exe+" /importprf "+$prffile ; -- Import the profile for outlook
SLEEP 1

; -- Set the default mail preference as Rich Text format 1996609 is Word, 199610 Rich Text Format
IF "196610" <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Options\Mail","EditorPreference")
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Options\Mail","EditorPreference","196610","REG_DWORD")
ENDIF

; -- Set the default Font to be Verdana 10 pt
$pltextfont = "3c0000000f0000e800000040c80000000600000000000000002056657264616e6100020000000000000000"
$pltextfont = $pltextfont + "0000000000201a493a38e9070001000000"
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Preferences","TextFontSimple",$pltextfont,"REG_BINARY")

; -- Changes the view to get rid of the Outlook Bar and show the "Explorer View"
IF $explorview = "Yes"
$expview = "010000002c0000000200000003000000ffffffffffffffffffffffffffffffff2c0000002c00000084"
$expview = $expview + "020000dc01000001000000000000000100000000000000c0000000640000001800000003000000"
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Office Explorer","Frame",$expview,"REG_BINARY")
ENDIF

; -- Check the box to empty deleted items on leaving Outlook - Now that we have the Outlook Profile Generated
IF $deleteitems = "Yes"
IF "1" <> READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Preferences","EmptyTrash")
$rc = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Preferences","EmptyTrash","1","REG_DWORD")
ENDIF
ENDIF

RETURN
ENDSELECT
ENDIF

HTH,

Kent

[ 15. October 2002, 23:51: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#70825 - 2002-10-15 11:54 PM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
OK..

{Edit - Tested with Outlook 98 on Windows 95}
{Second Edit - Tested with Outlook 2000 on W95}
{Second Edit - Tested with Outlook XP on WXP}
{Second Edit - Tested with Outlook 2000 on W2k}

{Third Edit - We have Exchange 2000 and AD}

Installed Windows 95 on a test system..

Changes for today are:
  • Re-Implemented FIXPRF.EXE for PROFILE Generation corrections
  • FIXPRF.EXE also is needed for generating the profile for Outlook XP as well
  • Quieted Profgen with a re-direct to nul - "> nul"
  • Outlook XP Testing - Completed
  • Windows 9x Testing - Completed
  • Use of more variables, changed @ldrive to @lserver for Win9x
  • Removed the Need for Winset, Putinenv for Windows 9x
Cheers,
Kent

[ 16. October 2002, 06:22: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#70826 - 2002-10-16 06:02 AM Re: Problem with kdyers outlook script
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
FYI..

Updated the following FAQ and specifically - Exchange/Outlook Configuration

[ 16. October 2002, 06:20: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 2 12>


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

Who's Online
1 registered (mole) and 598 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.075 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

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