Page 1 of 1 1
Topic Options
#127474 - 2004-10-06 04:07 AM How to check group membership in a group ?
westham Offline
Fresh Scripter

Registered: 2003-05-28
Posts: 16
Hi,

How do I check if DomainName\GlobalGroup is a member of the Local Adminstrators Group in the user machine. Coz' I need to check this condition so that the user will run subsequent scripts if that condition is not satisfied.

Thanks !

Top
#127475 - 2004-10-06 04:36 AM Re: How to check group membership in a group ?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
This has been asked and answered several times. Try the board search.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127476 - 2004-10-06 06:28 AM Re: How to check group membership in a group ?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
This UDF will do the trick.

LocalAdmin() - checks for membership of local admin group
http://www.kixhelp.com/udfs/udf/83341.htm

Top
#127477 - 2004-10-06 02:36 PM Re: How to check group membership in a group ?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
DOC,
I doubt it. Read his requirements. He wants to check DomainName\GlobalGroup not @UserID.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127478 - 2004-10-06 07:22 PM Re: How to check group membership in a group ?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Right you are...


Well I'm sure between FAQ and UDF their is a posted solution. There is also the SEARCH feature on the board.

I won't waste anymore of my time on this at least until he replies back with more questions. You know how often we offer up advice and then the poster never comes back.

Top
#127479 - 2004-10-13 09:11 AM Re: How to check group membership in a group ?
westham Offline
Fresh Scripter

Registered: 2003-05-28
Posts: 16
Sorrie for my super late reply as i was on medical leave for the past few days.

Is there a simpler solution ? I tried to do a search but it seems that the solution is more for checking membership of a user id rather than for a global group.

Yeah, Les is rt ! I'm looking for a solution for checking DomainName\GlobalGroup not @UserID.

Thanks in advance !

Top
#127480 - 2004-10-13 09:55 AM Re: How to check group membership in a group ?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here is one method
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=81736&page=43&view=collapsed&sb=3&o=all&fpart=1
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#127481 - 2004-10-13 03:59 PM Re: How to check group membership in a group ?
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
here's a function i use to add our admins to the local machine during our baseline checks.

Code:

function AddGroups($groupsToAdd)
dim $localAdmins, $group, $addName
$AddGroups = 0
$localAdmins = getobject("WinNT://" + @wksta + "/Administrators")
for each $group in $groupsToAdd
$addName = "WinNT://" + join(split($group, "\"), "/")
if not $localAdmins.IsMember($addName)
$AddGroups = 1
$localAdmins.Add($addName)
endif
next
endfunction



$groupsToAdd is an array of groups in the format domain\group1. But you would probably be interested in the line

Code:

$localAdmins.IsMember($addName)



_________________________
Eric

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 128 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.058 seconds in which 0.025 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