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: 3167
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: 3167
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: 3167
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, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.054 seconds in which 0.022 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