hack504
asked on
Script Help
I have a script that works on 32 but but i need to have it work on 64 bit
here is the script
'========================= ========== ========== ========== ========== =========
'
' NAME: DumpEventLogs.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : 1/12/2004
'
' COMMENT: Edit the Destination Server path below to indicate where to dump files to.
' Run this script on the server who's event logs are to be saved.
'
' This script and many more are included in
' The Spider's Parlor Admin Script Pack
'========================= ========== ========== ========== ========== =========
Dim DestServer
' Put in the UNC path for where you want the logs to be stored
DestServer = "e:\EventLogs\"
'Create the Time variables
sDate=FormatDateTime(Now() ,vbLongDat e)
'Right("0" & Month(Date),2) _
'& "-" & Right("0" & Day(Date),2) _
'& "-" & Right(Year(Date),2)
sTime = DatePart("h", Now) & DatePart("n", Now)
set oFSO = CreateObject("Scripting.Fi leSystemOb ject")
'Gets the log files for this machine
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper sonate, (Backup, Security)}!\\" _
& strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile")
'This section goes out and gets the hostname this is run on for us.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("S elect * from Win32_ComputerSystem",,48)
For Each objItem in colItems
strHOSTNAME = objItem.Name
NEXT
'Now archive the logs and clear them
if oFSO.FolderExists(DestServ er & sDate) then
For Each objLogfile in colLogFiles
strBackupLog = objLogFile.BackupEventLog _
(DestServer & sDate & "\" & strHOSTNAME & "_" & objLogFile.LogFileName & "_" & sDate & "_" & sTime & ".evt")
objLogFile.ClearEventLog()
Next
end if
please help
here is the script
'=========================
'
' NAME: DumpEventLogs.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : 1/12/2004
'
' COMMENT: Edit the Destination Server path below to indicate where to dump files to.
' Run this script on the server who's event logs are to be saved.
'
' This script and many more are included in
' The Spider's Parlor Admin Script Pack
'=========================
Dim DestServer
' Put in the UNC path for where you want the logs to be stored
DestServer = "e:\EventLogs\"
'Create the Time variables
sDate=FormatDateTime(Now()
'Right("0" & Month(Date),2) _
'& "-" & Right("0" & Day(Date),2) _
'& "-" & Right(Year(Date),2)
sTime = DatePart("h", Now) & DatePart("n", Now)
set oFSO = CreateObject("Scripting.Fi
'Gets the log files for this machine
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
& strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile")
'This section goes out and gets the hostname this is run on for us.
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("S
For Each objItem in colItems
strHOSTNAME = objItem.Name
NEXT
'Now archive the logs and clear them
if oFSO.FolderExists(DestServ
For Each objLogfile in colLogFiles
strBackupLog = objLogFile.BackupEventLog _
(DestServer & sDate & "\" & strHOSTNAME & "_" & objLogFile.LogFileName & "_" & sDate & "_" & sTime & ".evt")
objLogFile.ClearEventLog()
Next
end if
please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER