ADSI Problem

G

Guest

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
 
M

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top