Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Runtime Error 800A0007 Out of Memory 'Getobject'

Status
Not open for further replies.

ic1frosty

Technical User
May 25, 2003
37
GB
I am using the following script to save and clear down the event logs on a number of Win2k servers.

This currently works fine on all servers except 2. And I really cant see why this is happening.When run this script throws up a a VBScript runtime error 800A0007 Out of Memory 'getobject' error line 13 char 5 message.

There is 4gb memory on this box and I can't see why this happening. Is there any obvious that is missing form these servers thats cuasing this issue.


'Option Explicit
'On Error Resume Next

Dim strComputer
strComputer = "."
clearEVTLogs = "Yes"

Dim current: current = Now
Dim strDateStamp: strDateStamp = dateStamp(current)

strComputer = "."
strPath = objDir2 & "\"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate, (Backup, Security)}!\\" _
& strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile")
For Each objLogfile In colLogFiles
strCopyFile = strDateStamp & "_" & strComputer _
& objLogFile.LogFileName & ".evt"
strBackupFile = "D:\LogFiles\" & strDateStamp _
& strComputer & objLogFile.LogFileName& "EventLog" & ".evt"
strBackupLog = objLogFile.BackupEventLog _
(strBackupFile)
'WScript.Echo objLogFile.LogFileName & " backed up to " _
' & strBackupFile

If clearEVTLogs = "Yes" Then
objLogFile.ClearEventLog()
End If
Next

Function dateStamp(ByVal dt)
Dim d, m, y
y = Year(dt)
m = Month(dt)
If Len(m) = 1 Then m = "0" & m
d = Day(dt)
If Len(d) = 1 Then d = "0" & d
dateStamp = d & m & y
End Function


Thanks in advance.
 
I've had this issue when a WMI application is leaking memory. Restart the "Windows Management Instrumentation" service on the server and see if resolves the problem.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top