Page 1 of 1 1
Topic Options
#26443 - 2002-08-05 09:29 AM InGroup Question
uberpaco Offline
Fresh Scripter

Registered: 2002-08-02
Posts: 21
I want the script to run on all users except domain admins (dont want it running on the servers).
Can it be done? Something like what I have written here under, but a working ver.

IF Ingroup("Domain Users") and not ("Domain admins")
Then
do stuff
Else
Exit

Top
#26444 - 2002-08-05 10:18 AM Re: InGroup Question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
if you put this at the start of your script, just simple:
code:
if ingroup("domain admins") exit 0 endif

does the job.
after that line you can add the normal script for domain users.
anyway, for the style you stated (longer one with pretty much same func) it would look like:
code:
if ingroup("domain users") and not ingroup("domain admins")
;script
else exit 0
endif
;some additional stuff in script

anyway, I would prefer the exit immediately for speeds and simplicity's sake.

cheers
_________________________
!

download KiXnet

Top
#26445 - 2002-08-05 11:03 AM Re: InGroup Question
uberpaco Offline
Fresh Scripter

Registered: 2002-08-02
Posts: 21
Thanx a ton. Will make my life alot easier.
Top
#26446 - 2002-08-05 03:53 PM Re: InGroup Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Justa hint. Your If syntac is not correct. The correct syntax would be
code:
IF INGROUP("Domain Users") and not INGROUP("Domain Admins")
;do stuff
ELSE
; don't do stuff
ENDIF

There is no THEN and each IF requires an ENDIF and the second INGROUP was missing. Please read the KiXtart manual for correct syntax.
_________________________
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 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.172 seconds in which 0.111 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