Checking if a user account is enabled in .NET
Here's a handy little code snippet to figure out if a local windows user account is enabled or not using the System.DirectoryServices namespace.
private static bool IsUserAccountEnabled(string username)
{
try
{
var result = new DirectoryEntry { Path = "WinNT://" + … Continue reading