Page 1 of 1 1
Topic Options
#198786 - 2010-06-07 03:58 PM Wrong in the commad reference regarding "InGroup", or is it just me?
Nicklas Offline
Fresh Scripter

Registered: 2010-06-07
Posts: 6
Loc: Sweden
Hi,

when I was working on a new script I tryed to use the "InGroup"-command to check if the user was a member of several AD-groups. If he was, then a new shortcut would be copied to the desktop.

In the "command reference" on kixtart.org I found this example:

 Code:
IF INGROUP("Developers", "Testers", 1) = 1
    ? "Member of Developers AND Testers group"
ENDIF


I never got this to work, exept when I removed the "= 1".
 Code:
 
IF INGROUP("Developers", "Testers", 1)
    ? "Member of Developers AND Testers group"
ENDIF


Is it just me misunderstanding the "command reference", or is it a typo?

Top
#198787 - 2010-06-07 04:23 PM Re: Wrong in the commad reference regarding "InGroup", or is it just me? [Re: Nicklas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
What version of kix are you using? I'm on 4.61 and both ways work just fine.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#198788 - 2010-06-07 04:52 PM Re: Wrong in the commad reference regarding "InGroup", or is it just me? [Re: Mart]
Nicklas Offline
Fresh Scripter

Registered: 2010-06-07
Posts: 6
Loc: Sweden
Thanks for the reply!

I´m using KiXtart 2010 4.61 (24th of september 2009) (not beta).

This is the code i´m using now, and that works:

 Code:
If InGroup("Project", "LKP", 1)
	Copy ("\\server01\TS\Projectstart.lnk") ("%userprofile%\Desktop\Programs")
EndIf


The user has to be a member of both groups to get the shortcut.

Top
#198790 - 2010-06-07 07:13 PM Re: Wrong in the commad reference regarding "InGroup", or is it just me? [Re: Nicklas]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Can I ask a question?

Is there a reason for you to surround the source and destination with parenthesis?

I think what you want is:
 Code:
If InGroup("Project", "LKP", 1)
Copy "\\server01\TS\Projectstart.lnk" "%userprofile%\Desktop\Programs"
EndIF


If the original code is from AutoIT, and if memory serves, it uses parenthesis..

HTH,

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

Top
#198839 - 2010-06-11 10:07 AM Re: Wrong in the commad reference regarding "InGroup", or is it just me? [Re: Kdyer]
Nicklas Offline
Fresh Scripter

Registered: 2010-06-07
Posts: 6
Loc: Sweden
Sorry for the late reply.

No there is no special reason that I´m surrounding the source and destination with parenthesis. The code has been reused from a earlier script. To be honest, I´ve never thought about it since I't always worked.

Top
#198889 - 2010-06-22 02:59 PM Re: Wrong in the commad reference regarding "InGroup", or is it just me? [Re: Nicklas]
mahjohn Offline
Fresh Scripter

Registered: 2004-11-02
Posts: 26
I've used the "If InGroup" command for several years now. Make sure you have the service installed on your Domain Controller that answers the call for If InGroup "KXRPC.exe". An example of the code I use is below.

 Code:
If InGroup ("groupname")=1	
   Run "\\10.x.x.x\webfilter.exe"
EndIf

or
 Code:
If InGroup ("groupname") = 1
   Use M: "\\10.x.x.x\sharename"
EndIf


Edited by Mart (2010-06-22 03:17 PM)
Edit Reason: Please use code tags when posting code.

Top
#198890 - 2010-06-22 03:12 PM Re: Wrong in the commad reference regarding "InGroup", or is it just me? [Re: mahjohn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
The Kix RCP service is only needed for Win9x clients. All others work just fine without it.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

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 918 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.174 seconds in which 0.102 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