Hi Guys,
I am not a C# or a scripting guy. Would love to know how I could use this to get the list of computers from my AD domain. Your help would be appreciated!
Regards,
SAM
Thanks for the script
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hemant KumarRank #1,202 · 1.5K reputationPosted Jul 1, 2012, 6:07 PM EDT
If you know the AD path to the group already it would probably be easier to open a DirectoryEntry on that, then do a DirectorySearcher from there.
using (DirectoryEntry de = new DirectoryEntry("LDAP://somedomain/CN=FooBar")) { DirectorySearcher search = new DirectorySearcher(de, ("(objectClass=user)")); }There is also a flag on the Searcher for whether to drill down to sub containers, I forget the name off hand.