M
Marty Henderson
I'm attempting to backup event logs of all AD domain servers to a network
share. The BackupEventLog WMI method returns and error of 5 for all but one
node. I've tried this on two domains with the same results. The MSDN library
documents the following return values.....
0 Success
8 Privilege missing
21 Invalid parameter
183 Archive file name already exists
....but nothing about a 5. Is this a bug? Or something I may be doing? Here
is a code snippet.....
Set LogFileSet =
GetObject("winmgmts:{impersonationLevel=impersonate,(Backup)}!\\" &
strComputer)_
.ExecQuery("select * from Win32_NTEventLogFile where LogfileName='" &
strEVTtype & "'")
For Each objLogfile in LogFileSet
intRet = objLogFile.BackupEventLog(cLogTarget & "\" &
strBackupName)
If intRet <> 0 Then
strErrMsg = "Fatal Save-Clear_Events.vbs error in " &_
"Function CopyEVT(). " &_
"Failure attempting to backup the " &_
strEVTtype & " log on node " &_
strComputer & "..." & intRet
WshShell.LogEvent 2, strErrMsg
End If
Next
Where strComputer is the simple name of a server and strEVTtype is an event
log, such as
Application.
Any help is appreciated,
Marty
share. The BackupEventLog WMI method returns and error of 5 for all but one
node. I've tried this on two domains with the same results. The MSDN library
documents the following return values.....
0 Success
8 Privilege missing
21 Invalid parameter
183 Archive file name already exists
....but nothing about a 5. Is this a bug? Or something I may be doing? Here
is a code snippet.....
Set LogFileSet =
GetObject("winmgmts:{impersonationLevel=impersonate,(Backup)}!\\" &
strComputer)_
.ExecQuery("select * from Win32_NTEventLogFile where LogfileName='" &
strEVTtype & "'")
For Each objLogfile in LogFileSet
intRet = objLogFile.BackupEventLog(cLogTarget & "\" &
strBackupName)
If intRet <> 0 Then
strErrMsg = "Fatal Save-Clear_Events.vbs error in " &_
"Function CopyEVT(). " &_
"Failure attempting to backup the " &_
strEVTtype & " log on node " &_
strComputer & "..." & intRet
WshShell.LogEvent 2, strErrMsg
End If
Next
Where strComputer is the simple name of a server and strEVTtype is an event
log, such as
Application.
Any help is appreciated,
Marty