Page 1 of 1 1
Topic Options
#192758 - 2009-03-09 10:52 PM Outlook Exchange Mailbox Add
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
Hello again all,

I'm trying to add this in to my login script. I have looked at the link the FAQ section here:

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81563&site_id=1#import

I've tried the code there and it seems to die right at the FUNCTION OUTLOOK() statement. I've updated the code to match our primary exchange server name and I have copied the outlook.prf file to the specified location on our server and in the %temp% directory as well.

I know there is probably something stupid I am missing since I'm a newbie with scripting just thought I'd check to see if anyone had any thoughts.

Thanks again!

Top
#192760 - 2009-03-09 11:36 PM Re: Outlook Exchange Mailbox Add [Re: aacajo]
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
This is the error on line 1

ERROR: unknown command [{rtf1\ansi\ansicpg1252\deff0\deflang1033{/fonttbl{\f0\fnil\fcharset0]!
Script: Z:\path\aacajo.kix
Line: 1

Figured i should add that. Thanks.

Top
#192763 - 2009-03-10 12:13 AM Re: Outlook Exchange Mailbox Add [Re: aacajo]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Did you also include the outlook function in your script?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#192782 - 2009-03-10 03:44 PM Re: Outlook Exchange Mailbox Add [Re: Mart]
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
I have the FUNCTION OUTLOOK() in a seperate script named Outlook.kix and in my logon script I simply have CALL Outlook.kix.

I may be misunderstanding the use of the functions as well.

Thank you!

Top
#192783 - 2009-03-10 04:00 PM Re: Outlook Exchange Mailbox Add [Re: aacajo]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
If you "Call Outlook.kix". you are simply loading the function into your script, you are not executing the function.

You need to either place the UDF into a file and Call "function.udf" early in your script to load it, or simply paste the function into your script directly.

THEN - you can call the function via "Outlook(arg, arg, arg..)" (if args are not needed, then simply call "Outlook()" directly.)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#192784 - 2009-03-10 04:02 PM Re: Outlook Exchange Mailbox Add [Re: aacajo]
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
Ah guess I should have read his comments...to call function just use "outlook" in the script. I apologize. Feel free to delete this post based on my stupidity \:\)
Top
#192788 - 2009-03-10 04:20 PM Re: Outlook Exchange Mailbox Add [Re: aacajo]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Nah.. no stupidity involved, and others will learn.. \:\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#192792 - 2009-03-10 05:11 PM Re: Outlook Exchange Mailbox Add [Re: Glenn Barnas]
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
I suppose...:) Thanks Glenn!

I actually have ran in to another road block. When a user logs in on the computer the outlook needs to be prepaired by windows installer so the script hangs for a second. With that code found in the FAQ the outlook goes to the "Outlook 2003 Startup" screen without applying the PRF file. After I click cancel and log in and check the PRF file, I notice it has been changed...all that needs to happen is for the PRF file to be run to apply the settings.

Is there a way to change it so that the startup screen doesn't load up and it just applies the PRF file with no prompts? If you have any suggestions for a starting point that'd be appreciated. Thanks again!

Top
#192794 - 2009-03-10 05:22 PM Re: Outlook Exchange Mailbox Add [Re: aacajo]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You should delete the FirstRun registry value.

 Code:
$rc = DelValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run")


The 11.0 part should be changed to fit your needs.

9.0 = Office/Outlook 2000 (could also be 09.0 not sure. I do not have Office2K anymore)
10.0 = Office/Outlook XP (2002)
11.0 = Office/Outlook 2003
12.0 = Office/Outlook 2007

[edit]
Using Glenn's code below might be best to get the office/outlook version when you have several versions installed.
[/edit]


Edited by Mart (2009-03-10 05:47 PM)
Edit Reason: Added a comment.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#192796 - 2009-03-10 05:41 PM Re: Outlook Exchange Mailbox Add [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
You might find these functions helpful:


;; 
;;====================================================================== 
;; 
;;FUNCTION       OutlookVersion() / OutlookRelease() 
;; 
;;ACTION         Returns the Version or Release of MS Outlook 
;; 
;;AUTHOR         Glenn Barnas 
;; 
;;VERSION        1.0 / 2008/09/12 
;; 
;;SYNTAX         OutlookVersion() 
;;		 OutlookRelease(VER) 
;; 
;;PARAMETERS     VER - REQUIRED - OutlookRelease() only - the Outlook version code 
;; 
;;REMARKS        Returns the Outlook version code and release data 
;;		 This is useful when trying to auto-configure Outlook in a mixed-version 
;;		 environment. 
;; 
;;RETURNS        Integer / String - see individual function header for details 
;; 
;;DEPENDENCIES   none 
;; 
;;TESTED WITH    W2K, WXP, W2K3 
;; 
;;EXAMPLES       $OLVer = OutlookVersion() 
;;		 $OLRel = OutlookRelease($OLVer) 
; 
; Determine the most current version of Outlook. Returns a CODE representing the version found, 
; or ZERO if none found 
; Outlook Versions: 
; Code  Ver   Description 
;  1 -  8.0 - Office 97 
;  2 -  9.0 - Office 2000 
;  3 - 10.0 - Office XP 
;  4 - 11.0 - Office 2003 
;  5 - 12.0 - Office 2007 
; 
Function OutlookVersion()
 
  Dim $_Ie			; Index var - enumerator 
  Dim $_EKey			; Enumeration Key 
  Dim $_OVer			; Outlook Version 
 
  $_Ie = 0
  $_EKey = EnumKey('HKEY_CURRENT_USER\Software\Microsoft\Office', $_Ie)
  While Not @ERROR
    If Val($_EKey) > 0
      If Val($_EKey) > $_OVer
        If KeyExist('HKEY_CURRENT_USER\Software\Microsoft\Office\' + $_EKey + '\Outlook')
          $_OVer = Val($_EKey)
        EndIF
      EndIf
    EndIf
    $_Ie = $_Ie + 1
    $_EKey = EnumKey('HKEY_CURRENT_USER\Software\Microsoft\Office', $_Ie)
 
  Loop
 
  $OutlookVersion = IIf($_OVer > 0, $_OVer - 7, 0)
  If $OutlookVersion = 0
    Exit 2
  EndIf
 
  Exit 0
 
EndFunction
 
Function OutlookRelease($_Ver)
 
  Dim $_Path
 
  Select
    Case $_Ver = 1
      $_Path = ReadValue('HKLM\SOFTWARE\Microsoft\Office\8.0\Outlook\InstallRoot', 'Path') + 'outllib.dll'
    Case $_Ver = 2
      $_Path = ReadValue('HKLM\SOFTWARE\Microsoft\Office\9.0\Outlook\InstallRoot', 'Path') + 'outllib.dll'
    Case $_Ver = 3
      $_Path = ReadValue('HKLM\SOFTWARE\Microsoft\Office\10.0\Outlook\InstallRoot', 'Path') + 'outllib.dll'
    Case $_Ver = 4
      $_Path = ReadValue('HKLM\SOFTWARE\Microsoft\Office\11.0\Outlook\InstallRoot', 'Path') + 'outllib.dll'
    Case $_Ver = 5
      $_Path = ReadValue('HKLM\SOFTWARE\Microsoft\Office\12.0\Outlook\InstallRoot', 'Path') + 'outlook.exe'
  EndSelect
 
  $OutlookRelease = Split(GetFileVersion($_Path), '.')[2]
  Exit @ERROR
 
EndFunction
 
Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#192797 - 2009-03-10 06:07 PM Re: Outlook Exchange Mailbox Add [Re: Glenn Barnas]
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
Thanks a bunch for the replies! Those functions will come in handy for sure especially if I'm removing values from the registry. We have a range of versions here as it is a very large company. We're trying to phase out 2000 but are mostly all on 2003 right now.

I've added the registry deletion of the first run and it removes it fine however the windows installer still runs. At the bottom of the Outlook() function he also specifies the removal of this key. He also adds the key to apply the file which it doesn't seem to be doing.

Also even when I run through the windows installer process and run the script again it still pops up with the Outlook 2003 Startup screen. It still doesn't seem to be applying the PRF file to Outlook.

Any other suggestions? Thanks agian!


Edited by aacajo (2009-03-10 06:34 PM)

Top
#192813 - 2009-03-11 09:49 AM Re: Outlook Exchange Mailbox Add [Re: aacajo]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You cannot prevent the installer from running. This will happen the first time a user logs on.

We have just two registry writes to let outlook startup with a profile and skip the first run wizard. Al you need to do is create a default profile and change Path_goes_here to the actual path. In the default profile you can even use variables like %username%. It depends on your situation but it worked for me for several years now.

 Code:
$rc = DelValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run")
$rc = WriteValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", "Path_goes_here\outlook.prf", "REG_SZ")
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#192832 - 2009-03-11 08:22 PM Re: Outlook Exchange Mailbox Add [Re: Mart]
aacajo Offline
Fresh Scripter

Registered: 2009-02-13
Posts: 34
Loc: Canada
Awesome...it seems to work great now. He actually had those lines in his Outlook function. He had the path set to a variable declared at the top. I just changed the path to %temp%\outlook.prf for importing the prf file just to make sure it was going to the right place where he was sending the file in his copy.

Microsoft also mentions to remove the "FirstRun" from that same key. Which I added to the function.

Thank you both for your help! You guys RULE!

Top
Page 1 of 1 1


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

Who's Online
0 registered and 809 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.067 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