#169280 - 2006-10-12 04:08 PM
IF INGROUP HELP
|
ekainyah
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
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
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
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
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
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
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
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
|
|
|
|
#169289 - 2006-10-12 05:43 PM
Re: IF INGROUP HELP
|
ekainyah
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
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
|
|
|
|
#169292 - 2006-10-12 06:04 PM
Re: IF INGROUP HELP
|
ekainyah
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
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
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
|
|
|
|
#169296 - 2006-10-13 09:31 AM
Re: IF INGROUP HELP
|
ekainyah
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
|
|
|
|
#169299 - 2006-10-13 03:27 PM
Re: IF INGROUP HELP
|
ekainyah
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
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|