Page 1 of 1 1
Topic Options
#136726 - 2005-03-29 11:44 PM Enum Local Group Members
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
I'm not having any luck with this piece of code. Please help me fix it or point me in the proper direction? TIA!

Code:

Function LocalAdmins()
Dim $winntprovider, $objGroup, $obj

$winntprovider = 'WinNT://'+@domain+'/'+@wksta+'/Administrators,group'
$objGroup = GetObject($winntprovider)

If @error = 0
? "obtained binding: "+$winntprovider
For each $obj in $objGroup
? $obj.Name
Next
Else
? "failed to get binding"
EndIf
$objGroup = 0
EndFunction

_________________________
silence is golden, but duct tape is silver

Top
#136727 - 2005-03-30 12:09 AM Re: Enum Local Group Members
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Why you have both @domain+'/'+@wksta?
Should you not just have @wksta?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#136728 - 2005-03-30 01:17 AM Re: Enum Local Group Members
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
Quote:

Why you have both @domain+'/'+@wksta?
Should you not just have @wksta?




MS says it makes for faster name resolution....

Top
#136729 - 2005-03-30 01:21 AM Re: Enum Local Group Members
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
its...


$objGroup.members


Bryce

Top
#136730 - 2005-03-30 01:22 AM Re: Enum Local Group Members
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
Code:

Function LocalAdmins()
DIM $winntprovider, $objGroup, $obj

$winntprovider = 'WinNT://'+@DOMAIN+'/'+@WKSTA+'/Administrators,group'
$objGroup = GetObject($winntprovider)

If @ERROR = 0
? "obtained binding: "+$winntprovider
For Each $obj In $objGroup.members
? $obj.Name
Next
Else
? "failed to get binding"
EndIf
$objGroup = 0
EndFunction


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Jochen) and 204 anonymous users online.
Newest Members
MikeKrausnick, Ruggiero, xempa333, KroodjeBip, Thala
17470 Registered Users

Generated in 0.03 seconds in which 0.011 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org