Page 1 of 1 1
Topic Options
#27931 - 2002-08-28 02:15 PM IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
Hi there,

I have a problem with Kix 2001 v4.1 and the INGROUP function. This is the situation:

I have a Windows 2000 mixed mode domain where users who are member of a domain local group need some configuration settings set. The users are not directly member of the domain local group, but members of global groups that reside in the domain local group. My script code:
code:
IF INGROUP ("DLOC_WMB_APP_mpm") = 1
IF EXIST ("H:\MPM\") = 0
MD H:\MPM
ELSEIF
IF EXIST ("H:\OFFICE\SJABLONEN\NCCWWRD97.INI") = 0
COPY "F:\MPM\NCCWWRD97.INI" "H:\OFFICE\SJABLONEN\NCCWWRD97.INI"
ENDIF
ENDIF

Kix doesn't recognize the user beeing member of the domain local group, because the user is member of one of many global groups that are member of the domain local group.

Could someone assist me in this issue?

TIA,

Arno

Top
#27932 - 2002-08-28 02:25 PM Re: IF INGROUP and nested groups
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, it works for me.

I had to transfer all the mappings to be done with global groups which are members of local group... just because added some unix servers which are not DC and as such do not get local groups...

anyway, in NT domain, local group can't be member of local group. it has to be other way around.

then, your script has "syntax error" as it has word:
ELSEIF

it's not kix as it simply should be ELSE.

cheers.
_________________________
!

download KiXnet

Top
#27933 - 2002-08-28 02:53 PM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Hmm,

strange the manual says it has to work:
quote:

Remarks:
INGROUP can be used to check for groupmembership of groups that exist on the domain or server where the user is logged on, or to check for groupmembership of groups on a specific domain or server.
When checking for a local group, INGROUP identifies that the user is indirectly a member of the group by virtue of being a member of a global group which, in turn, is a member of the local group.

If you want to check for membership in a group on a specific domain or server, use the following format:

"OtherDomain\group"
–or–
"\\SomeServer\group"

For Windows 9x clients, INGROUP works on local groups only if the KiXtart RPC service is running.


_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#27934 - 2002-08-28 02:57 PM Re: IF INGROUP and nested groups
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might need to define the domain in your group check
code:
IF INGROUP ("DOMAIN\DLOC_WMB_APP_mpm")
ENDIF

There is also a 20-character limit on group anmes under Windows NT (see Script failing on 95 when group names > 20 character )
_________________________
There are two types of vessels, submarines and targets.

Top
#27935 - 2002-08-28 03:30 PM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
quote:
You might need to define the domain in your group check
Will try that [Wink]
quote:
There is also a 20-character limit on group anmes under Windows NT
Also with Windows 2000 AD [Confused]

Top
#27936 - 2002-08-29 10:48 AM Re: IF INGROUP and nested groups
Anonymous
Unregistered


Hi

Not sure this will help you too much, but the below is what I needed to do to figure out the way the revamped Ingroup works under 4.1x

code:
CLS
BREAK ON

FUNCTION checkingroup ($grouplist)
cls

AT(2,2) "Groups evaluated: "

FOR EACH $group IN $grouplist
"'" + $group + "' "
NEXT

at(5,2) $note
?

if INGROUP($grouplist,0) = 1
? "In at least one of the groups"
endif

if INGROUP($grouplist,0) = 0
? "Not in any of the groups checked"
endif

if INGROUP($grouplist,1) = 1
? "in all groups checked"
endif

if INGROUP($grouplist,1) = 0
? "not in all groups checked"
endif

?
? "Press any key to continue"
get $x
ENDFUNCTION

$grouplist = "domain admins","everyone" ; 2 groups I AM a member of
$note = "Expected response: 'in at least one' and 'in all'"
checkingroup($grouplist)


$grouplist = "domain admins2","everyone" ; I'm not in 'domain admins2'
$note = "Expect response 'in at least one' and 'NOT in all'"
checkingroup($grouplist)


$grouplist = "cricket fans","soccer fans" ; I'm not in either :-)
$note = "Expect response 'not in any' and 'NOT in all'"
checkingroup($grouplist)

:end

Hope it helps!

Regards
Doug

Top
#27937 - 2002-08-30 10:25 AM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
Adding the "domain\" before the group name didn't work. If I run the script in debugmode I can see that
code:
IF INGROUP ("WONEN\DLOC_WMB_APP_mpm") = 1

is executed, and at that moment the parsing of the script terminates without an error. Lines of script after this IF INGROUP will therefor not run.

Anyone a suggestion [Confused]

[ 30. August 2002, 10:40: Message edited by: Arno ]

Top
#27938 - 2002-08-30 10:55 AM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Arno,

I've adjusted your script with KixStrip (download from home.wanadoo.nl/scripting) to add error checking:
code:
?"- 0 - err = " @error " - "  @kix
?"- 1 - err = " @error " - " If InGroup ("WONEN\DLOC_WMB_APP_mpm") = 1
?"- 2 - err = " @error " - " If Exist ("H:\MPM\") = 0
?"- 3 - err = " @error " - " MD "H:\MPM"
?"- 4 - err = " @error " - " EndIf
?"- 5 - err = " @error " - " If Exist ("H:\OFFICE\SJABLONEN\NCCWWRD97.INI") = 0
?"- 6 - err = " @error " - " Copy "F:\MPM\NCCWWRD97.INI" "H:\OFFICE\SJABLONEN\NCCWWRD97.INI"
?"- 7 - err = " @error " - " EndIf
?"- 8 - err = " @error " - " EndIf
?"Done"

Please run this and give us the results.

[ 05. September 2002, 09:44: Message edited by: MightyR1 ]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#27939 - 2002-08-30 11:27 AM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
Patrick,

I've created a text.kix with your code in it and this is the result:

code:
C:\>\\10.118.15.210\netlogon\Update\Files\kix32.exe \\10.118.15.210\netlogon\KIX
TART\test.kix

- 1-0The operation completed successfully.? If InGroup (Script error :
unknown command !
?"- 1-" @error @serror"? If InGroup ("WONEN\DLOC_WMB_APP_mpm") = 1


C:\>

And that "else" shoud be "endif". I've noticed that I copy/pasted the code with that in it when i posted my question. The script on my server is with "endif" though.

[ 30. August 2002, 11:34: Message edited by: Arno ]

Top
#27940 - 2002-08-30 01:07 PM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Arno,

I've update the test code, PTA [Wink]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#27941 - 2002-09-02 02:41 PM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
Tnkx Patrick,

I'll test it tomorrow [Wink]

[ 02. September 2002, 14:42: Message edited by: Arno ]

Top
#27942 - 2002-09-05 09:24 AM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
Sorry for the late reply, but i've had internet connectivity problems.

This is the result:
code:
C:\>\\10.118.15.210\netlogon\Update\Files\kix32.exe \\10.118.15.210\netlogon\KIX
TART\test.kix

- 0--1

C:\>

Does that help [Confused]

[ 05. September 2002, 09:31: Message edited by: Arno ]

Top
#27943 - 2002-09-05 09:27 AM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Arno,

leave out the /d and try again. Which version of kiX are you running now?
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#27944 - 2002-09-05 09:33 AM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
Patrick,

I'd forgotten to remove the /d in the copy/paste. The result of the error was when Kix32 was ran without /d

My version is 4.0.2

Top
#27945 - 2002-09-05 09:45 AM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Edited the test script, please try again...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#27946 - 2002-09-05 10:00 AM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
You're fast with replies [Razz]

The updated result:
code:
C:\>\\10.118.15.210\netlogon\Update\Files\kix32.exe \\10.118.15.210\netlogon\KIXTART\test.kix

- 0 - err = 0 - 4.02
- 1 - err = 0 -
- 2 - err = 0 -
- 5 - err = 0 -
- 8 - err = 0 -
Done
C:\>


Top
#27947 - 2002-09-05 10:04 AM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Looking at this I make the following conclusions:

1. The user is a member of the group
2. The dir exists
3. The ini exists

Am I right?

If so, then your script works... [Big Grin]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#27948 - 2002-09-05 10:08 AM Re: IF INGROUP and nested groups
Arno Offline
Fresh Scripter

Registered: 2002-08-28
Posts: 9
Loc: The Netherlands
I deleted the H:\MPM folder and the ini file. Then I ran the test.kix again and both the folder and ini file where put back. It does seem that it works now.

Now to find out why it didn't before.

Top
#27949 - 2002-09-05 10:15 AM Re: IF INGROUP and nested groups
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Looking at it quickly the differences are:

1. added wonen\ to the ingroup command
2. enclosed the dir in quotes
3. changed elseif to endif

Good Luck with future scripting. If you get stuck you'll know where to go!!! [Wink]
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

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
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.203 seconds in which 0.046 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