Page 1 of 2 12>
Topic Options
#47175 - 2003-10-22 08:17 PM Use of InGroup
Scott A. Chase Offline
Fresh Scripter

Registered: 2003-10-22
Posts: 5
I am testing something out that I want to use in my standard logon script. I have a script I have been using for years that works fine basically detecting a user's global group memberships and mapping drives accordingly. I do this using "InGroup." I also check to see if a user is in more than one group and map differently as necessary. I use 95/98/NT/W2k/XP workstations and NT4 servers and have generally had no problems.

However, I have encountered a situation where I have had to use "InGroup32" or "InGrp." I don't know why and I can find no documentation on this. For example, the following:

SELECT
CASE InGroup(MIS) AND @WUserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$"
ENDSELECT

works only if I use "InGroup32" or "InGrp." Can anyone explain this to me?
Scott

Top
#47176 - 2003-10-22 08:24 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I would suggest trying the more standard syntax using quoted strings in the InGroup and doubling-up your dollar-sign ...

code:
SELECT
CASE InGroup("MIS") AND @WUserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$$"
CASE 1
ENDSELECT

-Shawn

Top
#47177 - 2003-10-22 08:32 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
As well, if this "just started" happening, and if you had made changes to other parts of your script, would strongly suggest you look for missing closing quotes " and/or ENDIF's in your code - use something like kixstrip to scan your code ...
Top
#47178 - 2003-10-22 08:32 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
And would you mind explaining to us what exactly "InGroup32" or "InGrp." are?
_________________________
There are two types of vessels, submarines and targets.

Top
#47179 - 2003-10-22 08:37 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ja, kinda curious those two names ... InGroup32 doen't even google (I thought everything googled!)
Top
#47180 - 2003-10-22 08:39 PM Re: Use of InGroup
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
InGrp is in the Google Groups and has a VB Reference.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47181 - 2003-10-22 08:41 PM Re: Use of InGroup
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Why are you doing the following?

code:
SELECT
CASE InGroup(MIS) AND @WUserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$"
ENDSELECT

You should get the desired effect with:
code:
IF InGroup("MIS") AND @WUserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$"
ENDIF

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47182 - 2003-10-22 08:43 PM Re: Use of InGroup
Scott A. Chase Offline
Fresh Scripter

Registered: 2003-10-22
Posts: 5
Thanks for you prompt replies. I have not added this code to my production script so the snippet I entered here is running standalone from the command line using kix32. As to explaining "ingroup32" and/or "ingrp," I can't. That is why I asked if anyone has any insight. Somewhere once, I found that I could make "ingroup32" work when "ingroup" did not. Once I accidently typed in "ingrp" and found that also worked where "ingroup" did not.

I tried running this using Shawn's suggestions and the mapping still does not occur. Back to the drawing board.
Scott

Top
#47183 - 2003-10-22 08:47 PM Re: Use of InGroup
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
OK..

Try this -
code:
IF InGroup("MIS") AND @UserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$$"
ENDIF

If this does not work, try this if you have multiple domains..
code:
IF InGroup("DOMAIN\MIS") AND @UserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$$"
ENDIF

You may have to add some debugging code..

Kent

[ 22. October 2003, 20:48: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47184 - 2003-10-22 08:48 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Still, the question is where did you get this from?

Maybe you have the impression that
code:
IF INGROUP32(test)

works because you see the desired result when in fact 'INGROUP32(test)' is syntactically incorrect.
_________________________
There are two types of vessels, submarines and targets.

Top
#47185 - 2003-10-22 09:12 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I think Jens hit the nail on the head ... depending on the version of kix32, your InGroup32(xxx) and InGrp(xxx) are probably being treated as simply strings which are always true.

By the way, which version of Kixtart you running ?

I would definitely go back to the proper syntax, then debug the real problem. Using Kent's code, put in some tracers like this:

code:
IF InGroup("MIS") AND @WUserID = "sys-sc"  

?"In da group..."

USE X: "\\POR-NT1\SCANS$$"

?"ERROR @ERROR : @SERROR"

ENDIF



[ 22. October 2003, 21:13: Message edited by: Shawn ]

Top
#47186 - 2003-10-22 09:27 PM Re: Use of InGroup
Scott A. Chase Offline
Fresh Scripter

Registered: 2003-10-22
Posts: 5
Kent, I tried your suggestions to no avail. Jens, as I said, I don't know the source of "ingroup32" or "ingrp" but have found that "ingrp32" works also. I ran kixstrip against the script and it found no errors. My logon process still uses an older version of kixtart that included "unlock," "ingrp32," "setw," and "unstick." I copied the 4.21 files to my net logon directory to demo it and came across this situation.

Nonetheless I have remedied my problem. Operator malfunction. Interestingly enough, the three unknown group functions either just did not work and mapped the drive anyhow or they ignored the group requirement and acted on the userid requirement.

Thanks for your time.
Scott

Top
#47187 - 2003-10-22 09:34 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
So your saying that these mysterious functions are custom UDF's, written by someone else in your organization ? In some UDF file sitting on a server ... than it all makes a little more sense than.
Top
#47188 - 2003-10-22 09:39 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
quote:
My logon process still uses an older version of kixtart that included "unlock," "ingrp32," "setw," and "unstick."
Now, what verison woudl that be? I've never come across a UNSTICK KiXtart function/command.

Can you post your complete script?
_________________________
There are two types of vessels, submarines and targets.

Top
#47189 - 2003-10-22 09:58 PM Re: Use of InGroup
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Now this is wierd..

Created a test script and it does not error out with ingrp32, InGrp, and Ingroup..

Here is the script -
code:
cls
break on

?@kix

If ingroup("Domain Users")
?"ingroup test for Domain Users - works"
?"ERROR @ERROR : @SERROR"
ELSE
?"ingroup test for Domain Users - does not work"
?"ERROR @ERROR : @SERROR"
ENDIF

If ingrp32("Domain Users")
?"ingrp32 test for Domain Users - works"
?"ERROR @ERROR : @SERROR"
ELSE
?"ingrp32 test for Domain Users - does not work"
?"ERROR @ERROR : @SERROR"
ENDIF

If InGrp("Domain Users")
?"InGrp test for Domain Users - works"
?"ERROR @ERROR : @SERROR"
ELSE
?"InGrp test for Domain Users - does not work"
?"ERROR @ERROR : @SERROR"
ENDIF

If InTest("Domain Users")
?"InTest test for Domain Users - works"
?"ERROR @ERROR : @SERROR"
ELSE
?"InTest test for Domain Users - does not work"
?"ERROR @ERROR : @SERROR"
ENDIF


get $k

And the results:
quote:

4.21
ingroup test for Domain Users - works
ERROR 0 : The operation completed successfully.Domain Users
ingrp32 test for Domain Users - works
ERROR 0 : The operation completed successfully.Domain Users
InGrp test for Domain Users - works
ERROR 0 : The operation completed successfully.Domain Users
InTest test for Domain Users - works
ERROR 0 : The operation completed successfully.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47190 - 2003-10-22 10:05 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Run it in debug mode (kix32 /d or DEBUG ON) and see how the lines in question get processed. KiXtart seems to be even more lenient than you think!
_________________________
There are two types of vessels, submarines and targets.

Top
#47191 - 2003-10-22 10:07 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Or take a look at this perfectly valid code snippet
code:
If ingrp32
("Domain Users")
?"ingrp32 test for Domain Users - works"
?"ERROR @ERROR : @SERROR"
ELSE

_________________________
There are two types of vessels, submarines and targets.

Top
#47192 - 2003-10-22 10:09 PM Re: Use of InGroup
Scott A. Chase Offline
Fresh Scripter

Registered: 2003-10-22
Posts: 5
I am not sure what version of Kixtart (the executable is from late 1997) that was and I believe those operators, though they came with the program, were 3d party. They were not functions.

BTW, that was my whole script. I am testing some functionality prior to inserting a new section in my script.

As to the other "in group" macros/functions, I think they just don't plain work or are not recognized. I realized that I had a real short script running on another domain that was mapping the drive no matter what group you were in. It never errored out. However, when I switched it back to "ingroup," I could not get it to map without using kix32 even though it was doing nothing different than my logon script in another domain using kixtart.

Scott

Top
#47193 - 2003-10-22 10:15 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Gotta love Kix !!! Its just like the KF shortcuts we (ok, some) use for boolean ...

$Form.Visible = True

We can rely on good olde Kixtart to convert most mal-formed code in simple strings, that always evaluate true (except for "0" and NOT "0" but thats another story) [Wink]

Top
#47194 - 2003-10-22 10:20 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Scott:

KIX32 /? on the command line will tell you the version. There's no 'third-party' stuff unless it's custom Kixtart code in form of UDFs, which requires kiXtart v4.x

Basically, you have a completely messed up script and you're lucky that KiXtart has this very forgiving syntax (free-format).
_________________________
There are two types of vessels, submarines and targets.

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 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.11 seconds in which 0.063 seconds were spent on a total of 13 queries. Zlib compression enabled.

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