Quote Originally Posted by chris128 View Post
For it to use the current user's credentials you need to not set the username or password properties
Oh. Ok. That should be easy. One more thing, if you don't mind. This is the code I'm using to get the OU/Container attributes and their values.

C# Code:
  1. foreach (PropertyValueCollection p in ChildObject.Properties)
  2.                                 {
  3.                                     ActiveDirectoryAttributeList ADAList = new ActiveDirectoryAttributeList();
  4.                                     ADAList.Attribute = p.PropertyName;
  5.                                     ADAList.AttributeValue = p.Value.ToString();
  6.                                     ChildNode.Attributes.Add(ADAList);
  7.                                 }

Your code defines ChildObject as a DirectoryEntry, with which you use to loop through the RootDirectory.Children. I then loop through all of the properties for the ChildObject to get the attributes and attribute values. I add those two data points to a list of a custom class called ActiveDirectoryAttributeList. I then add them to a property of AdTreeNode I added, called Attributes. All of that works just fine. I can see the attributes and their values during runtime, but it only pulls some attributes. Not all of them.

ADSI Edit for Engineering OU:



My app on that same OU: