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

active-directoryc++

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).

Best Solution

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

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