Looking for DirectoryServices.Properties options

  • Thread starter Thread starter agarrettb
  • Start date Start date
A

agarrettb

Hi all,

I have a directory entry object the specifies "members" in its
properties collection to retrieve:

groupEntry.Properties("member")

Instead of just using "member" to return members I am trying to find a
list of all possible values that Properties takes. Can't seem to
locate it in MSDN or Google.

???
 
thats a very good question, I was playing with DirectoryServices at the
beginning of the week and this could have come in very useful for me. I
was searching for "homedirectory" I eventually found a google thread
that told me the exact property to ask for, but it would have been
much more helpful if I had a full listing of the properties. Let me
know if you find this list and I will do likewise.

Thanks
 
Following lists all existing properties for the builtin administrators
group, and a list of all members in the "member" collection.
using(DirectoryEntry domain = new
DirectoryEntry("LDAP://domainName/CN=administrators,cn=builtin,DC=....,DC=....,DC=....",
"domain\\user", "pwd"))
{
foreach(string s in domain.Properties.PropertyNames)
{
Console.WriteLine(s + "\t\t" + domain.Properties.Value);
if (s == "member")
{
foreach(string ss in domain.Properties.Value as object[])
{
Console.WriteLine("-- {0}", ss);
}
}
}
}

Following sample lists all current properties of the local administrator.

using(DirectoryEntry domain = new
DirectoryEntry("WinNT://acer1/administrator,user"))
{
foreach(string s in domain.Properties.PropertyNames)
{
Console.WriteLine(s + "\t\t" + domain.Properties.Value);
}
}

Willy.
 
Back
Top