Page 1 of 3 123>
Topic Options
#169280 - 2006-10-12 04:08 PM IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
I am finding difficulties in getting this script to run successfuly. I want a different drive to be map for users depending on the group they belong to in the domain so i write this simple code but it does not work at all. Below is the script

IF INGROUP("ITDEPT")
USE T: "\\SERVER1\APPS"

ELSE

IF INGROUP("FINANCE")
USE P: "\\SERVER3\ACCOUNTS"

ELSE

IF INGROUP("SURPAC USERS")
USE G: "\\SERVER9\DATA"

ELSE ENDIF


BUT when a user in one of these groups logs on to the domain, he does not get the map drive. Hope somebody can really help me to sort this please


Regards
Edmund

Top
#169281 - 2006-10-12 04:29 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
structure is IF something ELSE something else ENDIF
So you might wanna do:
Code:

IF INGROUP("ITDEPT")
USE T: "\\SERVER1\APPS"
ENDIF


IF INGROUP("FINANCE")
USE P: "\\SERVER3\ACCOUNTS"
ENDIF


IF INGROUP("SURPAC USERS")
USE G: "\\SERVER9\DATA"
ENDIF


If you wanna use ELSE, it should in this case be used something like this:
Code:


IF INGROUP("SURPAC USERS")
USE G: "\\SERVER9\DATA"
ELSE
USE G: "\\SOMEOTHERSERVER\DATA"
ENDIF


This makes it that if you're in the group SURPAC USERS, g: gets mapped to \\server9\data, and if you're not in the group, it mappes something else to G: in this example.

Top
#169282 - 2006-10-12 04:58 PM Re: IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
i just try it again with what you written above but it still does not map the drive at all.
Top
#169283 - 2006-10-12 05:06 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Mkay.. First of, is the user in the group, etc etc?
second, try this:
Code:

IF INGROUP("ITDEPT")
'In group ITDEPT' ?
USE T: "\\SERVER1\APPS"
@ERROR ' - ERROR' @SERROR ' - SERROR' ?
ELSE
'NOT in group ITDEPT' ?
ENDIF


IF INGROUP("FINANCE")
'In group FINANCE' ?
USE P: "\\SERVER3\ACCOUNTS"
@ERROR ' - ERROR' @SERROR ' - SERROR' ?
ELSE
'NOT in group FINANCE' ?
ENDIF


IF INGROUP("SURPAC USERS")
'In group SURPAC USERS'
USE G: "\\SERVER9\DATA"
@ERROR ' - ERROR' @SERROR ' - SERROR' ?
ELSE
'NOT in group SURPAC USERS' ?
ENDIF


Second, is the drives already mapped?

Top
#169284 - 2006-10-12 05:12 PM Re: IF INGROUP HELP
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
If you need to do more than one comparison, Select - Case - EndSelect, is a much better way to do it.

Code:

Select
Case INGROUP("ITDEPT") = 1
USE T: "\\SERVER1\APPS"

Case INGROUP("FINANCE")= 1
USE P: "\\SERVER3\ACCOUNTS"

Case INGROUP("SURPAC USERS") = 1
USE G: "\\SERVER9\DATA"

EndSelect



You may want to also look at what the errors are thereby giving you an idea why they are not mapping

Code:

Case INGROUP("ITDEPT") = 1
? "InGroup error: "@error
USE T: "\\SERVER1\APPS"
? "Use Error: "@error


Top
#169285 - 2006-10-12 05:21 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Garg, what is a user is in two groups / all the groups ?
second, I prefer @SERROR - looking thro the error-codes isn't really my style ;P

Top
#169286 - 2006-10-12 05:25 PM Re: IF INGROUP HELP
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Details, details, what do you want... And yes @Serror is a good way to go as well
Top
#169287 - 2006-10-12 05:32 PM Re: IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
The drives are not already mapped and i just don't know what is happening here. I tried again with the above script and nothing happen. I am totally confused.
Top
#169288 - 2006-10-12 05:33 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
then lets start with how you're calling the script ? both during logon and now.
Top
#169289 - 2006-10-12 05:43 PM Re: IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
I will appreciate that very much b'cos when i tried using the kixtart last yr i had no succss in the normal inplementation so then i have to create a kix file like financ.kix and place this cmd kix32.exe finance.kix in each of the finance users profile under the user properties. That is really a tidious job to do so if i can get the normal way for kixtart to work, i will be very very grateful please.
Top
#169290 - 2006-10-12 05:52 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
well, I would appreciate if you provided the info I asked for so we can help you

Ways to start and execute kixtart-scripts during logons can be found in the faq-section otherwise ( a bit too much to bluur out here..;) )

Top
#169291 - 2006-10-12 05:53 PM Re: IF INGROUP HELP
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
What type of domain are you implementing KiX in?
How are you calling your script now..?
When testing your script how are you calling it?

Top
#169292 - 2006-10-12 06:04 PM Re: IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
ok, i am implementing kix on a windows 2003 server platform. The script is being run by placing this comand "kix32.exe surpac.kix" in the users properties profile. That is exactly what i am doing now. so please help me get off this tidious job.
Top
#169293 - 2006-10-12 06:08 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
mkay, good start.
But, that's not the way to call it.
Check this out: How to run kixtart
In case the link is broken, the thread you're looking for is under FAQ-section, titled 'Use of %0\..\ to launch KiX '.
Basically, in the userprofile-tab, use logon.bat or something like that.
In your logon.bat (placed on the notlogon-share), you call the script.

Top
#169294 - 2006-10-12 07:05 PM Re: IF INGROUP HELP
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Quote:


The script is being run by placing this comand "kix32.exe surpac.kix" in the users properties profile.




I would think this is OK if you just have Windows NT (and higher) Workstations, no Win9x.
I think another approach is GPO.
Create GPO on OU with the users that need a certain script.
Go to User Configuration --> Windows Settings --> Scripts (Logon/Logoff) --> Logon
Ad a new script, the "script name" is wkix32.exe, the "script parameters" is your script file. Do not forget to copy the files in the policiy directory (You can open a browser clicking the "Show Files" button in the "Logon Properties" Window).

Top
#169295 - 2006-10-13 08:12 AM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Witto, you sure about that? I've personally never seen it working (using kix kixscript.kix from the users profile-tab) - will have to try tho.
Top
#169296 - 2006-10-13 09:31 AM Re: IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
You see what i want to avoid is putting the command in users profile b'cos that is really tidious and if i can implement it with only script in the sysvol then that will be very easy.
Top
#169297 - 2006-10-13 09:38 AM Re: IF INGROUP HELP
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4665
Loc: The Netherlands
You could make a master script that calls the other scripts based on the user, a group, a site or whatever you need. If you put the master script in the users profile then changes would only have to be made in on place being the master script when a script for a new department, a new site, etc... is added.

Edited by Mart (2006-10-13 09:39 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#169298 - 2006-10-13 02:24 PM Re: IF INGROUP HELP
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
I really belive you need to check out the FAQ-section on how to set it up.
Top
#169299 - 2006-10-13 03:27 PM Re: IF INGROUP HELP
ekainyah Offline
Getting the hang of it

Registered: 2005-07-05
Posts: 51
Loc: Ghana
I am going through the FAQ-section to get the set up from stratch to see how it goes this time.
Top
Page 1 of 3 123>


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

Who's Online
0 registered and 241 anonymous users online.
Newest Members
dimi575, Drecksnacken, Nlill, webtools321, multiman
17734 Registered Users

Generated in 0.044 seconds in which 0.011 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