PLEEEEEEEEEEEEEEEEEEEASE HELP...
I have tried many things, but just cant seem to get it!.. The closest I
have come is to get a list of "LogonId" that represent a connection...
If anyone has any tips I sure would appreciate it...
TIA,
Bryan
[snip]
String ToClient = "";
//SelectQuery query = new SelectQuery("Win32_NetworkClient"); // NO
(returns network info)
//SelectQuery query = new SelectQuery("Win32_NetworkConnection"); // NO
(returns nothing!)
SelectQuery query = new SelectQuery("Win32_LogonSession"); // NO (returns
some kind of number (Login ID) rahter than the actual user ID)
//SelectQuery query = new SelectQuery("Win32_Account"); // NO (returns
everything...)
//SelectQuery query = new SelectQuery("Win32_ServerConnection"); // NO
(returns nothing!)
//SelectQuery query = new SelectQuery("Win32_ServerSession"); // NO
(returns nothing!)
//SelectQuery query = new SelectQuery("Win32_UserAccount"); // Returns
info as expected (but returns all). "Name" is the User ID
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject mo in searcher.Get())
{
ToClient += "~" + (String)mo["Caption"] + ", " + (String)mo["Description"]
+ ", " + (String)mo["LogonId"] + ", " + (String)mo["Name"] + ", " +
(String)mo["Status"];
}
} catch (Exception e) {
ToClient += "Error: " + e.ToString();
}
return ToClient;