Maybe the errors come up because all variables should be dimmed in your script. Do you have SETOPTION("Explicit", "On") in the main script? If so then you need to declare (DIM) all the variables used in the script you got from me. If not then can you lets us know what error come up? Is it just empty variables or does kix actually give some kind of error?

 Originally Posted By: biscuit

....

If There is a profile already there do you re-create it? Looks like you are using @homeshr, what are my other options, I have folder redirection enabled so I am not sure what the best place is...Just so you know this is on a SBS 2003 R2 machine...
….

I use @homeshrs because it is a unique location for every user (at least in my network it is), you can use whatever you want as long as the location is accessible for the user. If you have redirected some folders that should be no problem because the @homeshr macro is filled with the data that is in the user’s properties in AD.
Yep, every time the script runs it sets the registry values. That is one of the flaws in the script. It does not really matter but it could slow things down (don’t know the difference in time for checking a registry value and writing a registry value). A check to see if a profile exist and do the magic when there is no profile might be better.

 Originally Posted By: biscuit

....
When it runs from the netlogon directory this environment variable doesn't get set....
....


Try the code below (as a logon script) on a test user. I put in lots of debugging lines so you can see where thing go wrong. All screen output is written to a file called outlook_config_log.txt on the c: drive of the system that you are logging on to.

 Originally Posted By: biscuit

....
and it's because on the server I don't have outlook installed so it returns a blank, so the question is how can I have these ran against the local machine that is logging in instead.
....


Nope, it is not because on the server outlook is not installed. If you run it as a logon script it runs in the environment of user that is logging on.

 Code:
Break on

ReDirectOutput("c:\outlook_config_log.txt", 1)

;Get outlook version
$olpath = ReadValue("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", "Path")
?"Outlook path = " $olpath
$olversion = GetFileVersion($olpath + "outlook.exe", "ProductVersion")
?"Outlook version = " $olversion

Select
	Case Left($olversion, 2) = "11"
		;Outlook 2003
		Copy @LDRIVE + "\tools\outlook2003.prf" @HOMESHR + "\" + @USERID + "\outlook.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run")
		?"Deleting first run registry value result: " $rc
		$rc = WriteValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
		?"Write import prf registry value result: " $rc
	Case Left($olversion, 2) = "12"
		;Outlook 2007
		Copy @LDRIVE + "\tools\outlook2007.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "First-Run")
		?"Write import prf registry value result: " $rc
		$rc = WriteValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
		?"Write import prf registry value result: " $rc
EndSelect

ReDirectOutput("")
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.