Having a heck of a time trying to create a ton of AD user accounts in a specific
OU without having the users be forced to change their password upon a successful
login.
After creating the account (and committing the changes), I have the following
code that works:
// password info
userEntry.Invoke("SetPassword", new object[]{this.m_defaultPassword});
userEntry.Properties["pwdLastSet"].Value = 0;
userEntry.Properties["userAccountControl"].Value = 0x200; //ADS_UF_DONT_EXPIRE_PASSWD
userEntry.CommitChanges();
I've tried setting a value for the "pwdLastSet" property, and also trying
a few different combinations for the "userAccountControl" integer bitmap,
but no luck (either throwing exceptions or just not desireable results.
After searching various groups for solutions (managed or scripted), I'm still
at a loss, hence this posting. Any tips/pointers would be greatly appreciated.
--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp