Page 1 of 1 1
Topic Options
#44752 - 2003-09-03 08:43 PM Computer Account Membership
Akulassn Offline
Lurker

Registered: 2003-09-03
Posts: 2
Loc: Norwich
Hi all, have tried searching the forum for an answer on this one, but not had much joy.

What i'm trying to do is, deploy a couple of bits of software to a machine based upon its membership in a certain group on the domain.

So, i have the following...

Domain = MYDomain
Security Group = INSTSoftware
Computer = PCMGT01

How do i go about telling Kix to install the software on my machine if my computer is a member of the group "INSTSoftware".

We are running W2K Domain (Active Directory) and XP Clients.

Thanks in advance for any help.

Adrian

[ 03. September 2003, 20:44: Message edited by: Akulassn ]

Top
#44753 - 2003-09-03 08:48 PM Re: Computer Account Membership
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Searching for "computer in group" yielded: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=007176#000003

among others.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#44754 - 2003-09-03 09:22 PM Re: Computer Account Membership
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I'll post this as a function soon

code:
 
? ComputerInGroup('domain computers')


Function ComputerInGroup($group,optional $Domain)
Dim $oGrp
if not $domain $domain=@domain endif
$oGrp = GetObject("WinNT://" + $domain + "/" + $group + ",group" )
if @error exit 1 endif

if $oGrp.IsMember("WinNT://" + $domain + "/" + @wksta + "$$" )
$ComputerInGroup=1
else
$ComputerInGroup=0
endif
endfunction

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44755 - 2003-09-04 10:20 AM Re: Computer Account Membership
Akulassn Offline
Lurker

Registered: 2003-09-03
Posts: 2
Loc: Norwich
Sorry am being really think, i've used Kix before, but not ADSI (at least that look like what you've used in that example?). Where would i specify the group i wanted to check the machines membership for?

Thanks

Adrian

Top
#44756 - 2003-09-04 10:53 AM Re: Computer Account Membership
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
ComputerInGroup('domain computers')

as in:

if ComputerInGroup('domain computers')
? "I'm a member"
endif

but don't forget to put the UDF in the script
Read the FAQ forum on how to use UDFs if you don't know.
_________________________
How to ask questions the smart way <-----------> Before you ask

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
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

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