2014-09-20 42 views
-1

如何使用wmi清除同一域中的远程服务器上的事件日志?这两个服务器都是Windows 2003? 什么VB脚本可以用来清除Windows 2003中的日志? 我可以使用什么powershell脚本来清​​除Windows 2003中的日志? 我可以使用winevtutil或powershell comamnd从Windows 7中清除Windows 2003 Server中的事件日志吗? 这两台机器都在单独的域中?我可以从Windows 7计算机上提供管理帐户登录映射在Windows 2003服务器上的文件?wmi和vbscript在Windows 2003中清除远程服务器上的事件日志

+1

你可能想从这里开始你的研究:http://technet.microsoft.com/en-us/library/hh849789.aspx – 2014-09-20 14:42:17

+0

这似乎更像是一个系统管理不是一个编程问题给我,所以它应该在[ServerFault](http://serverfault.com/)上被询问。 – 2014-09-21 09:37:36

回答

0
C:\Users\User>wmic nteventlog call /? 

Method execution operations. 
USAGE: 

CALL <method name> [<actual paramlist>] 
NOTE: <actual paramlist> ::= <actual param> | <actual param>, <actual paramlist 
> 

The following alias verb(s)/method(s) are available: 

Call     [ In/Out ]Params&type     Status 
====     =====================     ====== 
BackupEventlog   [IN ]ArchiveFileName(STRING)   (null) 

ClearEventlog   [IN ]ArchiveFileName(STRING)   (null) 

因此,像

wmic /node:127.0.0.1 nteventlog where filename='system' call ClearEventLog 

是命令行版本。

在VBS中(&“。”是计算机名称,表示本地计算机,使用名称或IP地址)。

Set WMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & ".") 
Set logFile = WMI.ExecQuery("Select * from Win32_NTEventLogFile " & "Where LogFileName='System'") 
For Each F in LogFile 
    msgbox F.ClearEventLog 
Next 
相关问题