Click here to Skip to main content
14,486,454 members
   

C#

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:36
cofounderChris Maunder12-Jul-09 22:36 
PinnedHow to get an answer to your question Pin
Chris Maunder10-Nov-05 16:31
cofounderChris Maunder10-Nov-05 16:31 
QuestionOverloaded Methods with Generics Pin
#realJSOP3hrs 55mins ago
mva#realJSOP3hrs 55mins ago 
AnswerRe: Overloaded Methods with Generics Pin
OriginalGriff3hrs 13mins ago
mveOriginalGriff3hrs 13mins ago 
GeneralRe: Overloaded Methods with Generics Pin
#realJSOP2hrs 57mins ago
mva#realJSOP2hrs 57mins ago 
GeneralRe: Overloaded Methods with Generics Pin
OriginalGriff1 hr 19mins ago
mveOriginalGriff1 hr 19mins ago 
QuestionWpf Excel Pin
RajaMohammed.A26-Mar-20 3:55
MemberRajaMohammed.A26-Mar-20 3:55 
AnswerRe: Wpf Excel Pin
Richard MacCutchan26-Mar-20 4:12
mveRichard MacCutchan26-Mar-20 4:12 
QuestionC# Oracle SYSDBA connection string not able to working on windows 10? Pin
barathsamkumar25-Mar-20 4:39
Memberbarathsamkumar25-Mar-20 4:39 
AnswerRe: C# Oracle SYSDBA connection string not able to working on windows 10? Pin
OriginalGriff25-Mar-20 5:13
mveOriginalGriff25-Mar-20 5:13 
AnswerRe: C# Oracle SYSDBA connection string not able to working on windows 10? Pin
ZurdoDev25-Mar-20 10:07
mveZurdoDev25-Mar-20 10:07 
QuestionUser List Pin
Richard Andrew x6423-Mar-20 10:40
professionalRichard Andrew x6423-Mar-20 10:40 
I am using the below code to obtain a list of all local user accounts on the machine. But in addition to the "human" accounts, it returns all the other accounts, such as the SQLSERVER accounts and something called the WDAGUtilityAccount.

What is the property I should be checking for to determine which listed accounts are the "human" accounts, and which are machine accounts?

public static List<string> GetComputerUsers()
{
    List<string> users = new List<string>();
    var path =
        string.Format("WinNT://{0},computer", Environment.MachineName);

    using (var computerEntry = new DirectoryEntry(path))
    {
        foreach (DirectoryEntry childEntry in computerEntry.Children)
        {
            if (childEntry.SchemaClassName == "User")
            {
                users.Add(childEntry.Name);
            }

        }
    }

return users;
}




The difficult we do right away...
...the impossible takes slightly longer.

AnswerRe: User List Pin
Luc Pattyn23-Mar-20 16:25
sitebuilderLuc Pattyn23-Mar-20 16:25 
GeneralRe: User List Pin
Richard Andrew x6424-Mar-20 2:06
professionalRichard Andrew x6424-Mar-20 2:06 
GeneralRe: User List Pin
Dave Kreskowiak25-Mar-20 4:13
mveDave Kreskowiak25-Mar-20 4:13 
AnswerRe: User List Pin
Randor 25-Mar-20 5:11
professional Randor 25-Mar-20 5:11 
GeneralRe: User List Pin
Richard Andrew x6425-Mar-20 5:33
professionalRichard Andrew x6425-Mar-20 5:33 
GeneralRe: User List Pin
Randor 25-Mar-20 6:10
professional Randor 25-Mar-20 6:10 
GeneralRe: User List Pin
Richard Andrew x6425-Mar-20 6:22
professionalRichard Andrew x6425-Mar-20 6:22 
GeneralRe: User List Pin
Randor 25-Mar-20 8:38
professional Randor 25-Mar-20 8:38 
GeneralRe: User List Pin
Richard Andrew x6425-Mar-20 8:57
professionalRichard Andrew x6425-Mar-20 8:57 
GeneralRe: User List Pin
Randor 25-Mar-20 9:18
professional Randor 25-Mar-20 9:18 
AnswerRe: User List Pin
Randor 25-Mar-20 13:27
professional Randor 25-Mar-20 13:27 
GeneralRe: User List Pin
Richard Andrew x6425-Mar-20 13:36
professionalRichard Andrew x6425-Mar-20 13:36 
GeneralRe: User List Pin
Richard Andrew x6427-Mar-20 14:37
professionalRichard Andrew x6427-Mar-20 14:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.