問題描述
我正在嘗試使用活動(dòng)目錄來判斷用戶當(dāng)前是否已登錄.活動(dòng)目錄可以做到這一點(diǎn)嗎?
I am trying to use active directory to tell if a user is logged in currently. Is this possible with active directory?
我可以檢查用戶有什么角色 User.IsInRole(@"domain.comTeamLead")
I can check what role the user has User.IsInRole(@"domain.comTeamLead")
但是我看不到任何內(nèi)容來查看他們當(dāng)前是否已登錄.
But I'm not seeing anything to see if they are currently logged in or not.
推薦答案
嚴(yán)格使用 Active Directory,您將無法獲得此信息.Active Directory 不存儲(chǔ)此類信息.您可以通過 GPO 打開登錄審核并查詢個(gè)人計(jì)算機(jī),但這可能會(huì)很麻煩.
By strictly using Active Directory, you will not be able to get this information. Active Directory doesn't store this type of information. You can turn on Login Auditing through GPO and query individuals computers, but that could be messy.
外部解決方案可能是psloggedon:
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx
雖然這并不理想.
An outside solution could be psloggedon:
http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx
Though that is hardly ideal.
AFAIK 沒有開箱即用的數(shù)據(jù)存儲(chǔ)來跟蹤當(dāng)前登錄到域的用戶.
AFAIK there is no out of the box datastore that keeps track of which users are currently logged into a domain.
另一種選擇是制作一個(gè)登錄/注銷腳本,寫入特定的文件/數(shù)據(jù)庫(kù),您可以監(jiān)控該文件以查看誰登錄.
Another alternative could be to craft a logon/logoff script that writes to a particular file/database and you could monitor that file to see who is logged in.
這篇關(guān)于Active Directory 檢查用戶是否登錄的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!