#198786 - 2010-06-07 03:58 PM
Wrong in the commad reference regarding "InGroup", or is it just me?
|
Nicklas
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:
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".
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
|
|
|
|
#198788 - 2010-06-07 04:52 PM
Re: Wrong in the commad reference regarding "InGroup", or is it just me?
[Re: Mart]
|
Nicklas
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:
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
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:
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
|
|
Top
|
|
|
|
#198839 - 2010-06-11 10:07 AM
Re: Wrong in the commad reference regarding "InGroup", or is it just me?
[Re: Kdyer]
|
Nicklas
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
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.
If InGroup ("groupname")=1
Run "\\10.x.x.x\webfilter.exe"
EndIf
or
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 978 anonymous users online.
|
|
|