Page 1 of 1 1
Topic Options
#204361 - 2012-02-28 01:47 PM Computer In An AD Group
Fergieman Offline
Getting the hang of it

Registered: 2010-02-25
Posts: 58
Loc: Ireland
Guys , trying to right some script , but not successful.
I want to check if a computer is in a security group and if so , run some reg changes. My code was like this

IF @WKSTA INGROUP("GROUPNAME") = 1
DONOTSOMETHING
ELSE
ENDIF

Can I check if computers are part of an AD group with KIX ?

Top
#204362 - 2012-02-28 02:32 PM Re: Computer In An AD Group [Re: Fergieman]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Not with that syntax nor with the builtin Ingroup. Ingroup is for users only.

Please see ComputerInGroup - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=195717#Post195717

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1
_________________________
(... better days ahead)

Top
#204363 - 2012-02-28 03:30 PM Re: Computer In An AD Group [Re: Allen]
Fergieman Offline
Getting the hang of it

Registered: 2010-02-25
Posts: 58
Loc: Ireland
Thanks Allen

I had a look at those udfs earlier , but I could not get them to work.

Top
#204365 - 2012-02-28 03:47 PM Re: Computer In An AD Group [Re: Fergieman]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
crash course to udf's.
copy the whole udf (with description to the endfunction) in to your script file.
leave it like that. don't alter it.

then, where you tried to use the ingroup, use computeringroup() instead.
_________________________
!

download KiXnet

Top
#204366 - 2012-02-28 04:04 PM Re: Computer In An AD Group [Re: Lonkero]
Fergieman Offline
Getting the hang of it

Registered: 2010-02-25
Posts: 58
Loc: Ireland
Ah , my bad....I was trying to edit the UDF , as I thought it was meant to be amended for my environment. I did as you said Lonkero , and it worked straight away !! This could save me alot of time
Top
#204367 - 2012-02-28 04:09 PM Re: Computer In An AD Group [Re: Fergieman]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
 Originally Posted By: Fergieman
I want to check if a computer is in a security group

I presume InGroup() will do this during Computer Startup Scripts, when the local system account is the account running the script.

Top
#204368 - 2012-02-28 07:40 PM Re: Computer In An AD Group [Re: Witto]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Witto
 Originally Posted By: Fergieman
I want to check if a computer is in a security group

I presume InGroup() will do this during Computer Startup Scripts, when the local system account is the account running the script.
No, InGroup() only checks the user account, not the computer account.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#204369 - 2012-02-28 09:57 PM Re: Computer In An AD Group [Re: Les]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Lonk... you mind if I steal your crash course and put in place of my link to "How to use UDFs?" ;\)
_________________________
(... better days ahead)

Top
#204371 - 2012-02-28 10:18 PM Re: Computer In An AD Group [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't mind... \:\)
_________________________
!

download KiXnet

Top
#204386 - 2012-03-01 06:07 PM Re: Computer In An AD Group [Re: Lonkero]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Les,
You are totally right. I forgot about the EnumComputerIngroups() function I posted
 Code:
Dim $Groups, $Group
$Groups = EnumComputerIngroups(1)
For Each $Group in $Groups
	? $Group
Next
If Ascan($Groups,'MySecurityGroup') > -1
	? 'Yes'
Else
	? 'No'
EndIf

Top
#204392 - 2012-03-01 07:45 PM Re: Computer In An AD Group [Re: Witto]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I remember putting in a feature request to Ruud to enhance InGroup() to include the computer account with an additional parm. With the various UDFs that can do it, it became low priority.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#204402 - 2012-03-02 01:47 AM Re: Computer In An AD Group [Re: Les]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and bet now it's no-prio ;\)
_________________________
!

download KiXnet

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 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.069 seconds in which 0.031 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