Hi all,
I wanted to design a wmi query that returns me a list of all "real" user
accounts defined on the local machine. As you may know, the accounts are
defined in win32_account. The field SIDType indicates what kind of account it
is(user, group, Domain, etc.). (On MSDN:
http://msdn.microsoft.com/library/en...32_account.asp)
This results in the following query --> "select * from win32_account where
SIDType=1"
This query doesn't bring me any result! But if I query this table with a
username (e.g. select * from win32_account where Name='alw') I get my own
account and my SIDType is 1!
My Code (simple):
sbyte b = SByte.Parse("1");
Console.WriteLine(b);
ManagementObjectSearcher searcher = new
ManagementObjectSearcher("select * from Win32_Account where SIDType="+b);
foreach (ManagementObject service in searcher.Get())
{
Console.WriteLine("User Caption = " + service["Name"]);
}
Can anybody help me?
Regards Alexander