2011-06-22 34 views
2

wmiでアクティブなセッションのみを表示する方法はありますか? 問題は、Win32_LogonSessionに非アクティブ/切断セッションが表示されることです。wmiでアクティブなセッションを取得する(Win32_LogonSessionは非アクティブ/古いセッションも返す)

ManagementScope scope = new ManagementScope(ManagementPath.DefaultPath); 
SelectQuery query = new SelectQuery("Win32_LogonSession"); 
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query); 
ManagementObjectCollection results = searcher.Get(); 
foreach (ManagementObject mo in results) 
{ 
    PrintWmiObject(mo); 
} 

これの出力は、この

AuthenticationPackageのようなものである - ケルベロス

キャプション -

説明 -

InstallDate -

ログオンID - 10179411

LogonType - 10

名 -

のStartTime - 20110617083244.547220 + 120

ステータス - 何について

答えて

0

:それは表示されません

SelectQuery query = new SelectQuery("Select * from Win32_LogonSession Where LogonType = 10") 
+0

セッションがアクティブであるかどうか – Marshal

関連する問題