2014-09-20 84 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 
相關問題