How can I list all the available properties of an AD user?

pisceswzh

Well-known member
Joined
Mar 19, 2007
Messages
96
Programming Experience
1-3
Hi,

I am working on a project to create an AD user using VB.NET.

For the time being, I have been able to create it using

VB.NET:
Dim newuser As DirectoryEntry = de.Children.Add("CN=Tommy Wang", "user")

But I found it is not so easy to assign value to its property

Now I only know how to assign its First Name using

VB.NET:
newuser.Properties("givenname").Add("Tommy")

Since I saw it somewhere that this entry have the property of "givenname".

I am just wondering how can I list all the available properties?

Thanks!
 
VB.NET:
        For Each prop As System.DirectoryServices.PropertyValueCollection In newuser.Properties
            Console.WriteLine(prop.PropertyName)
        Next
 
Thank you, Rocksteady!

I have been able to create a new user account. But I found the new user created does not have an Exchange email account. Any idea how to enable the Exchagne email account for that new user?
 
Back
Top