Page 1 of 1 1
Topic Options
#39831 - 2003-05-01 10:07 PM Logical OR/Ingroup
Anonymous
Unregistered


Could someone help me with the following code,please:

IF INGROUP("\\@WKSTA\Administrators") <> 1 or INGROUP("\\@WKSTA\Power Users") <> 1

This code works only if the user belongs to the workstation's Administrators group. If I remove and put the user in the Workstation's Power Users group then the code doesn't work.

This is to be used as part of a logon script to check whether the user belongs to EITHER of the two local groups mentioned.

Thanks.

Top
#39832 - 2003-05-01 10:10 PM Re: Logical OR/Ingroup
Kdyer Offline
KiX Supporter
*****

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

Welcome to the board..

You should be able to do this -

IF INGROUP("\\"+@WKSTA+"\Administrators")=0 OR INGROUP("\\"+@WKSTA+"\Power Users")=0

HTH,

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

Top
#39833 - 2003-05-01 10:14 PM Re: Logical OR/Ingroup
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What version @KiX?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#39834 - 2003-05-01 10:15 PM Re: Logical OR/Ingroup
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
KiX 3.x would return 2 for local group.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#39835 - 2003-05-01 10:20 PM Re: Logical OR/Ingroup
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
KiX 4.x Returns:
0 The user is not a member of a group with this name
1 The user is a member of a global group with this name
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#39836 - 2003-05-01 10:37 PM Re: Logical OR/Ingroup
Anonymous
Unregistered


I'm using Kix32.exe version 4.2 on a Windows 2K Pro.
Top
#39837 - 2003-05-01 10:43 PM Re: Logical OR/Ingroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:
IF INGROUP('\\'+@WKSTA+'\Administrators') OR INGROUP('\\'+@WKSTA+'\Power Users')
; user is member of Administrators and/or Power Users
ELSE
; user neither Administrator nor Power User
ENDIF

It all depends on what you are checking for, which you have not stated explicitly.
_________________________
There are two types of vessels, submarines and targets.

Top
#39838 - 2003-05-01 11:14 PM Re: Logical OR/Ingroup
Anonymous
Unregistered


Just tried Sealeopard's suggestion and it worked! Thanks everyone.
Top
#39839 - 2003-05-25 06:33 PM Re: Logical OR/Ingroup
kzoo Offline
Lurker

Registered: 2003-05-25
Posts: 1
Loc: bosnia
ok... i'm a REAL novice to KIX scripting... I most certainly see the benefit.. and with much practice hope to be able to take my training wheels off one day... [Smile]

ok.. my question is how do i get the 'ingroup' function to work with remote computers? My environment is setup such that users execute a simple dos batch file which maps drives. I would like to add the flexibility to map according to group membership on a local server, not a domain controller. I can get 'ingroup' to work with either groups on the local computer or on the domain, but not on a stand-alone server.

The stand-alone server has all groups in place... and this server is not a member of the domain.

According to http://www.kixscripts.com/define.asp?id=54, it seems that all I need to do is use the following command:

IF INGROUP("\\SERVERNAME\SHARENAME") = 2

but I cannot get it to work.

Oh... I'm using kix ver. 4.21

Thanks in advance for your help... -cs

Top
#39840 - 2003-05-25 08:41 PM Re: Logical OR/Ingroup
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Please do NOT hijaak this thread and follow board etiquitte as outlined in our FAQ section.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#39841 - 2003-05-25 11:55 PM Re: Logical OR/Ingroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Additionally, the computer has to be part of the domain. Otherwise you must create all users as local users incl. their respective passwords on that stand-alone computer, too. however, you will then not be able to use INGROUP as this only works for the active user, and the user account on the stand-alone computer would be a different one, though tht name's the same.

You might want to make yoruself familiar with NT domain/security models.

Please follow ABC's of KiXtart board etiquette and message to new forum users as Les already pointed out to you.
_________________________
There are two types of vessels, submarines and targets.

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
0 registered and 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.049 seconds in which 0.022 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