>Say, that's vastly better than that tacky old NT Resource Kit method. I'm gonna use your code in the future, too, if you don't mind. Thanks.
>
>Hmm...I spoke a little too soon, maybe. That's great for domains, but how can I get the domain Group lists with this technique? That's what I usually need. I'm probably just missing some little thing, when I'm modifying the code to drill down to groups...
Hi Bruce,
Go for it, using ADSI is pretty well documented on MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/adsi/adsi_reference.asp?frame=trueTo identify groups, all you would do is change the look for oItem.Class = "Group".
lcMyDomain = "MYDOMAIN"
oDomain = GetObject('WinNT://' + lcMyDomain)
FOR EACH oItem IN oDomain
IF oitem.Class = "Group"
? oItem.Name, oItem.Class
ENDIF
ENDFOR
If you want to see membership, you can do something like:
LOCAL oGroup
lcMyDomain = "MYDOMAIN"
oGroup = GetObject("WinNT://" + lcMyDomain + "/Administrators")
FOR EACH oMember IN oGroup.Members
?oMember.Name
ENDFOR
- Brian
VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)
www.wulfsden.com