Home All Groups Group Topic Archive Search About
Author
28 Jul 2006 11:23 AM
Vikas Manghani
Hi
Can anyone tell me how I can check the status of an account in Active
Directory using C#.
I mean, I need to know whether, Account is locked, Password expired or
Password needs to be changed at next logon, etc. The problem is that in all
these cases, .Net throws a generic exception and there is no way for me to
know what was the exact cause of the error.
This is a little urgent.

Thanks in advance
Vikas Manghani

Author
1 Aug 2006 1:23 PM
Marc Scheuner
>Can anyone tell me how I can check the status of an account in Active
>Directory using C#.
>I mean, I need to know whether, Account is locked, Password expired or
>Password needs to be changed at next logon, etc. The problem is that in all
>these cases, .Net throws a generic exception and there is no way for me to
>know what was the exact cause of the error.

The problem is not .NET - it's LDAP. Whether your user logs in when
his account is disabled or he's locked out, or when his password is
expired or an invalid password has been entered all result in the same
error message. There's nothing you can do to change that, I'm afraid.

You can check for "is that account disabled?" from an admin
perspective - but the user logging on has no way of telling, sorry.

Marc

AddThis Social Bookmark Button