Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I am having some issues with how fast my VBScript is able to pull event log data over the network from my server using WMI. My server is not slow. It is a Pentium 4 1.6G and functioning only as a DC. The code below is section of concern. The variables s and l are the server name and log file type (eg system, application, etc) respectively. When I run this script against the locally connected server (so network speed is not an issue), I get a very very slow response, to a crawl, seems like data is just trickling in.
My question is this: When I execute the "Select * from Win32_NTLogEvent where LogFile=l" does the colLoggedEvents variable gets populated with the data right away or does it just create a connection to the object? It seems like it does not get all the data right away. So as I loop through the For Next loop, that is when it goes and gets the data. Am I right?
---Code---
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & s & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent where LogFile='" & l & "'")count = 1
For Each objEvent in colLoggedEvents
WScript.Echo(count & " " & objEvent.LogFile)
count = count + 1
Next---End Code---

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |