標籤:windows 日誌 篩選 登入
1. 簡單的需求?
需求:windows server2008R2環境,需要統計一下近7天使用者登入次數。
好像很簡單,我知道server2008登入事件的事件ID不就行了,開始統計一下,4624是登入事件ID:
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M00/9D/FB/wKioL1mJffPCEQAKAABj3Wfdmug974.jpg-wh_500x0-wm_3-wmp_4-s_2590690013.jpg" title="image001.jpg" alt="wKioL1mJffPCEQAKAABj3Wfdmug974.jpg-wh_50" />
統計結果如下:
650) this.width=650;" src="https://s1.51cto.com/wyfs02/M01/9D/FB/wKiom1mJff3gdcYhAABIHNSLSWQ337.jpg-wh_500x0-wm_3-wmp_4-s_3066764099.jpg" title="image002.jpg" alt="wKiom1mJff3gdcYhAABIHNSLSWQ337.jpg-wh_50" />
好像並沒有這麼多次登入?
通過查看登入日誌,發現在真正的登入時間,是這條日誌,去其他不同的是,此條日誌記錄的進程名是winlogon.exe 要實現比較精確的篩選,需要從這裡入手
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M01/9D/FB/wKioL1mJfgTRBQCLAAA8wmTxFqo049.jpg-wh_500x0-wm_3-wmp_4-s_1918614137.jpg" title="image003.jpg" alt="wKioL1mJfgTRBQCLAAA8wmTxFqo049.jpg-wh_50" />
2. 進一步篩選
點擊“事件屬性”裡面的“詳細資料”中,可以看見一條資訊,後面會用到:
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M02/9D/FB/wKioL1mJfhCwlYhcAAAQburBby0914.jpg-wh_500x0-wm_3-wmp_4-s_2099575490.jpg" title="image004.jpg" alt="wKioL1mJfhCwlYhcAAAQburBby0914.jpg-wh_50" />
在“篩選當前日誌”中,選擇“XML”
650) this.width=650;" src="https://s2.51cto.com/wyfs02/M00/9D/FB/wKioL1mJfhrignR_AABlmC5nCH0878.jpg-wh_500x0-wm_3-wmp_4-s_3252773210.jpg" title="image005.jpg" alt="wKioL1mJfhrignR_AABlmC5nCH0878.jpg-wh_50" />
勾選“手動編輯查詢”,並確認:
650) this.width=650;" src="https://s1.51cto.com/wyfs02/M00/9D/FB/wKiom1mJfiWQH94uAAB-eEv-Iys525.jpg-wh_500x0-wm_3-wmp_4-s_3453463506.jpg" title="image006.jpg" alt="wKiom1mJfiWQH94uAAB-eEv-Iys525.jpg-wh_50" />
在手動編輯中加入以下設定
*[EventData[Data[@Name=‘ProcessName‘] and (Data=‘c:\windows\system32\winlogon.exe‘)]] and
(裡面的PrcessName和winlogon.exe就是前面在“事件屬性”裡面的“詳細資料”中看到的):
650) this.width=650;" src="https://s5.51cto.com/wyfs02/M01/9D/FB/wKiom1mJfi3hU9S1AABxFh6PEp0867.jpg-wh_500x0-wm_3-wmp_4-s_678700348.jpg" title="image007.jpg" alt="wKiom1mJfi3hU9S1AABxFh6PEp0867.jpg-wh_50" />
點擊確定後,篩選出的結果就是準確的登入結果了。
3. windows server 2012的登入篩選
在windows server2012中,可能會有一些小變化,但是也沒關係,按照之前的解決思路即可。下面可做參考:
*[EventData[Data[@Name=‘ProcessName‘] and (Data=‘c:\windows\system32\winlogon.exe‘)]] and
*[EventData[Data[@Name=‘LogonType‘] and (Data=‘10‘)]] and
補充
XML裡面也可以對其他想要的資訊進行篩選,有興趣可以試試。
本文出自 “記錄與學習 提高與分享” 部落格,請務必保留此出處http://huandidi.blog.51cto.com/23337/1954555
精準的篩選windows使用者登入事件