Last post Sep 30, 2014 03:46 PM by smirnov
Sep 30, 2014 03:01 PM|uid633445|LINK
I am trying to get user AD entry information using the entry's property dictionary. I want to get specific user info (ie account locked, etd); however, when I view the keys for entry's property dictionary I do not see a key for
userAccountControl and when I run the code the user.Properties["userAccountControl"].Value returns null. What am I doing wrong? see code below:
DirectoryEntry user = new DirectoryEntry("LDAP://" + server +
objectDn, userName, password);
int val = (int)user.Properties["userAccountControl"].Value;
//newUser is DirectoryEntry object
user.Properties["userAccountControl"].Value = val | 0x80000;
Sep 30, 2014 03:05 PM|smirnov|LINK
Is user null too or it's pointed to the right DirectoryEntry?
Sep 30, 2014 03:22 PM|uid633445|LINK
user comes back with everything. When; however, I look at the propereties Key values there are somewhere around 32 values but none are "userAccountControl".
Sep 30, 2014 03:46 PM|smirnov|LINK
Did you try to access LDAP under admin account to see if maybe there is an issue with a security?