Page 1 of 2 12>
Topic Options
#189659 - 2008-09-14 05:57 AM Putting it all together.....
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Hi, have a questions, ok several that i hope someone will be kind enough to help me along the way. A little background, I am a network designer but volunteer at my church helping with the IT stuff. Originally I was just to support the network side of things but ended up doing much more and the latest is setting up a new server/domain controller. I have pretty much have the server pretty much ready to go and the last thing that I am struggling with is login scripts. Most of all of my work/play deal with linux, so you can see that I have had to read quite alot regarding MS servers and how they like to do things. So here is what I am trying to accomplish I have most of the pieces I just need a better understanding of how to put it together.

What I would like to accomplish is to create a Outlook/exchange profile if the user needs one (I want to use Kdyers code, i have created my outlook profile), mount certain drives on the server based on groups ( I have code to do this), mount the common network printers ( I have code to do this). So what I am wrestling with is how to have a main script that runs and then calls each of the subscripts to complete. I am also trying to understand how to/where to place the files on the server. I am using SBS 2003 R2 and intend to use a GPO and assign a startup script to accomplish. If anyone has some guidance/how to's that would help me on my way it would be greatly appreciated. Thanks.

Top
#189661 - 2008-09-14 01:20 PM Re: Putting it all together..... [Re: biscuit]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Hi Biscuit, welcome to the board.

-1 How to create one master script that calls all other (sub)scripts?
You could use the Call command like shown below.

 Code:
?"Starting Outlook profile creation, please wait...."
Call @ldrive + "\outlookscript.kix"
?"Done."
?
?"Started mapping network drives, please wait...."
Call @ldrive + "\mapdrivesscript.kix"
?"Done."
?
?"Stated mapping network printers, please wait...."
Call @ldrive + "\mapprinterscript.kix"
?"Done."
?
?"Logon script is done.


-2 Where to put the files on the server?
You can put them in the netlogon/sysvol share on your domain controller.

-3 A startup script?
You'd be better of with a logon script because the mapped printers, drives and the outlook profile depend on the user that is logging on.
You can set it with a GPO just fine. If you use kix32.exe as the script and put the name of your master script in the parameters section then you should be done. I always use the full path to kix32 and the script (\\domain.local\sysvol\kix32exe and \\domain.local\sysvol\somescript.kix). It should look in the sysvol folder automatically but better safe then sorry.

Introduction to Assigning Logon Script via Group Policy
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#189662 - 2008-09-14 02:39 PM Re: Putting it all together..... [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Biscuit,

Welcome!


1. You could use the pre-built login script from my site to do all of this. This script is in use at dozens of sites without code modification.

Simply define the resource records in the config file to map drives and printers. You can control what is mapped by generic privilege (anyone, notguest, admin), group membership, or OU membership. There are complex mapping capabilities - you can require membership in multiple groups; membership in one (set of) group(s) and not other(s); or even map only when the user is NOT a member of a (set of) group(s).

Another powerful feature is path rewriting. This lets you map dozens of different resources to the same place based on user, group, OU, or network subnet. Let's say you have 10 departments and each has a unique share. You decide that each department should map their share to the T: drive. Each department is represented by a distinct OU. You could create 10 resource records based on the OU membership, or, you could create 1 resource record and 10 lookup values using Path Rewriting. The resource path "&OU:Dept&" would be translated to a correct UNC path by looking for the user's OU in the Dept lookup record.

Once basic resource mappings are complete, you can display message files and run commands to customize the user environment, such as using Kent's Outlook profile script. You can Run them asynchronously, Shell them to run synchronously, or even Call other Kix scripts, taking advantage of the built-in variables and UDFs.

2. \\MyDomain\netlogon is probably the quickest/easiest way to push files to the netlogon share across the network, where they will be replicated to other DCs. In SBS, it's unlikely you'd have a second DC, and even if you did, it would be not be of much value.

3. You can't use Startup scripts - those control computer initialization, not user environment initialization. If you're new to login scripting, I'd avoid using GPOs to define them and instead simply define "Kix32.exe" in each user's Login Script profile field, especially in an SBS environment where there's no dedicated admin. Do you really want "Joe's cousin's son" (he has a PC at home...) tinkering with GPOs when you're on vacation? ;\) Been here, done this - SBS+Volunteer=Keep It Simple!

LogIn scripts - defined in the user profile - run in an envoinment where the Netlogon share is the initial directory. This makes things easy to find. LogOn scripts - defined by GPO - need to have full UNC paths defined for everything, and are a bit less forgiving. Also, referencing UNC paths for everything, admins often refer to specific servers - \\server\netlogon - instead of the domain - \\%USERDOMAIN%\netlogon. This practice can wreak havoc when DCs are downed for maintenance or replaced. This is almost the same as Mart's "@ldrive + '\mapdrivesscript.kix'" - I just prefer a system environment var over the macro. $LDRIVE isn't a drive letter as the name implies, but a UNC reference to the Netlogon share on the authenticating DC. It really doesn't matter which you use - "6 of one, half dozen of another" as they say in the Old Country. Just pick one method and use it consistently.

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

Top
#189744 - 2008-09-19 04:37 AM Re: Putting it all together..... [Re: Glenn Barnas]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Thanks Matt and Glenn, so I have been looking at Glenns scripts and reading, reading...I have 2 little ones so I can only do things later, ya know like I have all the free time I want from 8:30 to 6am, lol. So what I am trying to figure out is how to put it to use I know you say to use /sysvol/ directory and I see that but SBS has a default bat file that is used when you connect a new PC to the domain, it looks something like this:
\\xyzSERVER02\Clients\Setup\setup.exe /s xyzSERVER02

So my question is Glenn, how do I go about incorporating your scripts with the one that is already there, I wasn't sure if I could just put all of the files in there or if I needed to do something else. I know this is probably a noob question but I can't seem to find the answer anywhere...Thanks for the universal script and your help...

Top
#189778 - 2008-09-21 06:58 PM Re: Putting it all together..... [Re: biscuit]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Glenn, First off thanks for the site and scripts I am reading and playing with them right now. One question that I have is that why can I not read the contents of the kixstart.kix file, I thought this would be a normal text based script file. What am i missing? Thanks.
Top
#189784 - 2008-09-22 09:13 AM Re: Putting it all together..... [Re: biscuit]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You should be able to read the script with lets say notepad. There is no colour coding in notepad but it should work just fine.

Did you tokenize the scripts? If so then you need to un-tokenize it before you can read it in a text editor.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#189790 - 2008-09-22 02:30 PM Re: Putting it all together..... [Re: biscuit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Because I offer tech-support for the login script (and certain other utilities), I only distribute it in a Tokenized format.

It's highly customizable without scripting, and if users changed the code, I'd be unable to support it effectively. Thus, you won't be able to read the script.

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

Top
#189791 - 2008-09-22 02:41 PM Re: Putting it all together..... [Re: Glenn Barnas]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Thanks Glenn, I have most of it working the way that I want it would just be nice to be able to look at the code (I come from an open source world), I can understand about folks modifying etc, but if I am to install the code in a production environment it would be nice to be able to see what the actually code looks like. The last thing that I need to integrate is kdyers outlook profile creation, so far I am calling everything from the login.bat file and I was just going to call his script after calling yours, just add an additional \0%\kix32.exe outlook.kix, or is there a better way. In kdyers notes it says you just need to call outlook but i think that is from a kix script...anyone have any suggestions. Thanks.
Top
#189792 - 2008-09-22 03:08 PM Re: Putting it all together..... [Re: biscuit]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Configuring Outlook from a kix script is kinda easy. Have a look at the script below.

What does it do?
1 - Get the path to outlook.exe from the registry.
2 - Get the productversion of outlook.exe.
3 - Select the actions to take based on the version (11 = 2003 and 12 = 2007)
4 - Copy the default profile from the server to a private location for the user.
5 - Delete the FirstRun registry value so outlook does not prompt to setup a mail account the first time it is started.
6 - Set the ImportPRF registry value and point it to the location you copied the profile to.

The default profile can be created with the custom installation wizard that comes free as part of the resource kit on every Office 2003 CD or can be downloaded from the Microsoft website as part of the Office 2003 resource kit.

 Code:
Break on

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

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")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
	Case Left($olversion, 2) = "12"
		;Outlook 2007
		Copy @LDRIVE + "\tools\outlook2007.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "First-Run")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
EndSelect


[edit]
Now that I'm think about it it might be best to build in a check if outlook is actually installed and not do all this stuff when it is not.
I copied the code from my logon script and all clients always have outlook so it was not necessary to check for the presence of outlook.

something like:
 Code:
If  $olpath <> ""
	; configure outlook.
Else
	; do nothing.
EndIf

[/edit]


Edited by Mart (2008-09-22 03:14 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#189798 - 2008-09-22 06:21 PM Re: Putting it all together..... [Re: biscuit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
I relate to open source, which is why I publish most things here or on my site.. Just can't with this anymore since its now in use in some large financial environments.

Login.bat isn't needed - just "Kix32.exe Kixtart.kix" in the profile. The resource records will control drive and printer mapping before any commands are run, so all network resources will be available.

You can easily call Kent's script from my login script by creating a COMMAND resource record:
 Code:
[CreateOutlookProfile]
CLASS=COMMAND
PATH=\\domain\netlogon\Outlook\MkOProfile.kix
METHOD=CALL

This will call the MkOProfile kixtart script from the same environment as the login script, which means you don't have to load another copy of Kix32.exe. It assumes the script is in the netlogon share, but you can put it anywhere that the user has read access. The MkOProfile script is basically Kent's script with a little bit of wrapper logic to decide if a profile needs to be created - if not, it just exits. The MkOProfile can launch any other commands needed to complete the profile creation.

If the current version of Kent's Outlook.kix will exit if a profile already exists, then just replace the MkOProfile.kix with Outlook.kix in the above example.

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

Top
#189893 - 2008-09-26 04:01 AM Re: Putting it all together..... [Re: Glenn Barnas]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
So where can I can I find the mkOprofile.kix file? I looked on your site but if it is there I missed it. Thanks.
Top
#189896 - 2008-09-26 01:27 PM Re: Putting it all together..... [Re: biscuit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
No, you won't find mkOprofile.kix on my site...

You need to use Kent's (KDyer) script or Mart's example above as a separate script. I used the name mkOprofile.kix as an example. When you create your standalone script from Mart's or Kent's code, you should add a few lines to the beginning that will simply exit if a proper profile already exists. Once you have a script to create the profile, you can use my example above to call it from the login script.

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

Top
#189913 - 2008-09-27 07:16 AM Re: Putting it all together..... [Re: Mart]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
 Originally Posted By: Mart
Configuring Outlook from a kix script is kinda easy. Have a look at the script below.

What does it do?
1 - Get the path to outlook.exe from the registry.
2 - Get the productversion of outlook.exe.
3 - Select the actions to take based on the version (11 = 2003 and 12 = 2007)
4 - Copy the default profile from the server to a private location for the user.
5 - Delete the FirstRun registry value so outlook does not prompt to setup a mail account the first time it is started.
6 - Set the ImportPRF registry value and point it to the location you copied the profile to.

The default profile can be created with the custom installation wizard that comes free as part of the resource kit on every Office 2003 CD or can be downloaded from the Microsoft website as part of the Office 2003 resource kit.

 Code:
Break on

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

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")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
	Case Left($olversion, 2) = "12"
		;Outlook 2007
		Copy @LDRIVE + "\tools\outlook2007.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "First-Run")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "ImportPRF", @HOMESHR + "\" + @USERID + "\outlook.prf", "REG_SZ")
EndSelect


[edit]
Now that I'm think about it it might be best to build in a check if outlook is actually installed and not do all this stuff when it is not.
I copied the code from my logon script and all clients always have outlook so it was not necessary to check for the presence of outlook.

something like:
 Code:
If  $olpath <> ""
	; configure outlook.
Else
	; do nothing.
EndIf

[/edit]


So I have not had any luck getting Kent's code to work I have a profile and looking at your code, going to try it next...couple of questions. 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...Thanks.

Top
#189915 - 2008-09-28 06:43 AM Re: Putting it all together..... [Re: biscuit]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Mart/Glenn, Need some advice...I am using Mart's code above and it's kind of working..;) when I run it from the machine it works however when I run it from the netlogon directory it doesn't....and I think I have figured it out. When it runs from the netlogon directory this environment variable doesn't get set....

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

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. I will keep reading but thought this would be a softball for you guys.. Thanks.

Top
#189916 - 2008-09-28 01:53 PM Re: Putting it all together..... [Re: biscuit]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
How are you invoking the command when you are testing? It shouldn't matter where the script is..

On the PC where you are testing, you should run
 Code:
\\MyDomain\netlogon\kix32.exe \\MyDomain\netlogon\OutlookScript.kix

Of course, change the MyDomain to your local domain name, and the proper script name (and subfolder path, if used).

The commands you pointed out reference the local computer (where the script is running) and not the computer where the script is stored.

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

Top
#189917 - 2008-09-28 03:13 PM Re: Putting it all together..... [Re: Glenn Barnas]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
 Originally Posted By: Glenn Barnas
How are you invoking the command when you are testing? It shouldn't matter where the script is..

On the PC where you are testing, you should run
 Code:
\\MyDomain\netlogon\kix32.exe \\MyDomain\netlogon\OutlookScript.kix

Of course, change the MyDomain to your local domain name, and the proper script name (and subfolder path, if used).

The commands you pointed out reference the local computer (where the script is running) and not the computer where the script is stored.

Glenn


Ok, So when I run it that way it works, however when it is ran from the logon script it is not working, when I mean not working it is not copying the file to the location that I want it to. Here is what I have in my logon.ini file:

[CreateOutlookProfile]
CLASS=COMMAND
PATH=\\domainname\netlogon\outlook.kix
METHOD=CALL

all of the files are in the netlogon directory, any thoughts?


Edited by biscuit (2008-09-28 06:43 PM)

Top
#189918 - 2008-09-28 07:18 PM Re: Putting it all together..... [Re: biscuit]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Mart/Glenn, ok so it looks like I am getting errors on the variables in Mart's script, which is listed above they are:

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

Funny thing is if I manually run the script from the workstation ie, \\domainname\\netlogon\kix32.exe \\domainname\netlogon\outlook.kix it works, but I get errors when defined in the login.ini, I have tried call/shell etc...thanks for providing tips to look at...

Top
#189920 - 2008-09-28 08:16 PM Re: Putting it all together..... [Re: biscuit]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
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.

Top
#189922 - 2008-09-28 10:15 PM Re: Putting it all together..... [Re: Mart]
biscuit Offline
Fresh Scripter

Registered: 2008-09-14
Posts: 16
Thanks Mart for the reply let me give you both pieces, I am using Glenn's script but alsotrying to use yours that work just not both together so here goes....my login.ini which is used by Glenn's kixxtart file:

 Code:
[CreateOutlookProfile]
CLASS=COMMAND
PATH=\\dpcserver02\netlogon\outlook.kix
METHOD=call


Mart's code with embellishments ( I am still messing with and have alot commented out right now:

 Code:

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


;If  $olpath <> ""

         ;If NOT Exist (@LSERVER + "\" + "users\" + @USERID + "\outlook.prf")
                                          
           ; configure outlook profile

    ;Get outlook version
Select
	Case Left($olversion, 2) = "11"
		;Outlook 2003
            	;Copy @LDRIVE + "outlook2003.prf" @HOMESHR + "\" + @USERID + "\outlook.prf"
                 Copy @LDRIVE + "outlook2003.prf" + " " @LSERVER + "\" + "users\" + @USERID + "\outlook.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPRF", @LSERVER + "\" + "users\" + @USERID + "\outlook.prf", "REG_SZ")
	Case Left($olversion, 2) = "12"
		;Outlook 2007
		;Copy @LDRIVE + "outlook2007.prf" @HOMESHR + "\" + @USERID + "\outlook.prf"
                Copy @LDRIVE + "outlook2007.prf" + " " @LSERVER + "\" + "users\" + @USERID + "\outlook.prf"
		$rc = DelValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "First-Run")
		$rc = WriteValue("HKCU\Software\Microsoft\Office\12.0\Outlook\Setup", "ImportPRF", @LSERVER + "\" + "users\" + @USERID + "\outlook.prf", "REG_SZ")
EndSelect
          ;EndIf
;Else
	; do nothing.
;EndIf

It's the first 2 variables that it is having problems with, either one gives me:
 Code:
error undefined variable [olversion]!
or
error undefined variable [olpath]!


I'm not sure about the SETOPTION, i've been reading through Glenn's documentation buit nothing has jumped out at me. Thanks.


Edited by biscuit (2008-09-28 10:15 PM)

Top
#189923 - 2008-09-28 10:31 PM Re: Putting it all together..... [Re: biscuit]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Yes, we have a winner. Houston we do not have a problem!

The error you are getting is the one that I mentioned. All variables need to be declared.

Put the line below at the top of the outlook profile script and it should work. What happens now is that kix expects all variables to be declared and the ones in my script are not (at least some of them) so you need to declare them. Now kix finds some variables that are not declared so it exits the script and all further actions are canceled so no outlook profile is created. There may be other variables that need to be declared in my script like $rc but it could be that Glenn is using the same variable name so they are already declared. You may only declare a variable once otherwise you will get an error telling you that there are doubly declared variables.

 Code:
DIM $olversion, $olpath


[edit]
Oh and BTW you are checking if outlook.prf exists on the users home drive. I did that also but then added a piece of code to check the file date and replace the file if the file date was different from the one on the server. But that is for later use. Let’s first get the basics to work.
[/edit]


Edited by Mart (2008-09-28 10:35 PM)
Edit Reason: Added some stuff.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.076 seconds in which 0.027 seconds were spent on a total of 14 queries. Zlib compression enabled.

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