How does the userAccountControl property work in AD?
Let's say I want to create a new user account and set it to enabled (it's disable by default), and also set the 'password never expires' option to true. I can do something like this and it works:
//newUser is a DirectoryEntry object
newUser.Properties["userAccountControl"].Value = 0x200; // normal account
newUser.Properties["userAccountControl"].Value = 0x10000; //password never expires
Normally, I would think the second line would wipe the first one out, but it doesn't. How does that work? Can I combine them in one line? How would I then take away that value if I wanted to have their password expire? My knowledge with AD and LDAP is minimal, so any input would be helpful.
Thanks!