How can I get a list Local Windows Users (Only the Users that appear in the windows Logon Screen)

Just add a reference to System.Management in a Console Application and try this code: using System; using System.Management; using System.Linq; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { ManagementObjectSearcher usersSearcher = new ManagementObjectSearcher(@”SELECT * FROM Win32_UserAccount”); ManagementObjectCollection users = usersSearcher.Get(); var localUsers = users.Cast<ManagementObject>().Where( u => (bool)u[“LocalAccount”] == true && (bool)u[“Disabled”] == … Read more