本帖最后由 newfish 于 2013-4-12 01:47 编辑
- strComputer = "."
- Set objWMIService = GetObject("winmgmts:" _
- & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
- Set colEvents = objWMIService.ExecQuery _
- ("Select * from Win32_NTLogEvent WHERE Logfile = 'Security' and EventCode='540' ")
- dim strm
- For each objEvent in colEvents
-
- strm = objEvent.Message ' 这一句出错, 只获取的到 一行,然后报错.. 但是我直接用objEvent.Message.readline 又报错....
-
-
-
-
-
- do until mstr.atendofstream
-
- If instr(mstr.ReadLine,"用户名") <>0 then
- wscript.echo mstr.ReadLine
- end if
-
- loop
-
- Next
复制代码 但是用FSO的话 又不能load " objEvent.Message "
不熟悉VBS ..求指教... |