I have an application that checks to see if a user exists (if not create it) every time it starts. This is done as follows:
bool bUserExists = false; Directo
This should do it (when you can't use System.DirectoryServices.AccountManagement):
static bool userExists(string sUser) { using (var oUser = new DirectoryEntry("WinNT://" + Environment.MachineName + "/" + sUser + ",user")) { return (oUser != null); } }