Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows 2000 Users
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00812720
Message ID:
00813066
Views:
9

>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=true

To 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform