lock active office accounts programmatically
i have close user accounts active office programmatically c#.
unfortunately doesn't work around useraccountcontrol attribute. each i set useraccountcontrol 528 (=normal comment w/ lockout flag), active office won't accept value resets but offer notice 512 (=normal account).
now i attempted close comment providing crude certification (see below), nonetheless doesn't work either.
int retries = 0;
while (!adsuser.isaccountlocked && retries < max_lock_retries)
{
retries++;
try
{
new directoryentry(userpath, logonname, incorrectpassword).refreshcache();
}
locate (exception)
{
/* ... */
}
adsuser.getinfo();
}
any ideas?
Comments
Post a Comment