Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get User Account Status (Locked/Unlocked) from Active Directory on C-Sharp / C#

I need to find a way to check if an Active Directory UserAccount has his account locked or not.

I've tried userAccountControl property in a Windows 2000 AD but that property does not change a byte when I force an account to get locked (by trying to log on to a workstation providing the wrong password for that specific user) And I can tell by using ADExplorer.exe utility made by semi-god -> Mr. Russinovich

I've seen that in the 3.5 Framework they use the method .InvokeGet("userLockedOut"); but I'm trying to do this in a Enterprise Application that was written in .Net Framework 1.1 and there's no chance of using newer ones (just if you thought of suggesting so).

like image 872
monoco Avatar asked Apr 03 '09 23:04

monoco


People also ask

How do I find out who is locked to a user account in Active Directory?

The domain account lockout events can be found in the Security log on the domain controller (Event Viewer -> Windows Logs). Filter the security log by the EventID 4740. You should see a list of the latest account lockout events.


1 Answers

Here is a link with all the info on Active Directory stuff...

http://www.codeproject.com/KB/system/everythingInAD.aspx

like image 51
bytebender Avatar answered Sep 28 '22 15:09

bytebender