Re: ExecQuery hangs whole script but GetObject is fine

From: Gerry Hickman (gerry666uk_at_yahoo.co.uk)
Date: 02/19/05


Date: Sat, 19 Feb 2005 02:53:28 +0000

Hi Brandon,

Please can you write a small script that attempts this ExecQuery, then
ensure it hangs three times on the rogue machine and works three times
on a good machine, then post it here.

Connect to the rogue machine as a domain admin, right-click "My
Computer" then "Manage"; does the security log instantly appear on screen?

Brandon McCombs wrote:

> Hi everyone,
>
> I have a relatively big VBS file to handle connecting to every valid
> machine account in a win2k3 ADS domain and to backup the security event
> log to a file server. For each machine account in ADS the script
> connects to the WMI interface, does a query to get the list of logs of
> name "Security" of which there is of course only one, and then uses the
> BackupEventLog() method to back up the file.
>
> The problem stems from the fact that some machines lately have trouble
> executing the query and the query hangs and thus the whole script
> hangs. The GetObject() returns fine but the ExecQuery does not so a 'on
> error resume next' is useless w/o an error, same with checking for an
> error code. I've tried ConnectServer and it didn't seem to make a
> difference as, again, I can connect just fine but the query doesn't ever
> complete.
> I'm very new to VBS and especially WMI so I might be missing something
> easy to get around this problem. Also, the scheduled task that normally
> runs this script runs at 1am every night and when I come in around 9 or
> 10am the task is still running so if there is a timeout on the query it
> must be a long one.
>
> Does anyone have any ideas?
>
> The client machines are all XP SP2 and I'm executing the script from one
> of the DCs as a domain admin but in the scheduled task that the script
> normally runs in there is a separate account belonging to the domain
> admins group that the task runs as. Both manual and scheduled methods
> have trouble.
>
> thanks
> brandon
>

-- 
Gerry Hickman (London UK)


Relevant Pages

  • ExecQuery hangs whole script but GetObject is fine
    ... machine account in a win2k3 ADS domain and to backup the security event ... For each machine account in ADS the script ... executing the query and the query hangs and thus the whole script ... of the DCs as a domain admin but in the scheduled task that the script ...
    (microsoft.public.win32.programmer.wmi)
  • RE: Hanging VBScript in Windows2003 Task Scheduler
    ... I have a few scripts that run in a scheduled task. ... I comment them all out when I put the script on the server to run ... > working like a charm on Windows XP and Windows 2000 Servers. ... > script just hangs on Windows 2003 server when scheduled thru Scheduled ...
    (microsoft.public.scripting.vbscript)
  • Re: Wont work on some systems
    ... I also put in some echo statements to see where the script ... It does the query but it seems to get stuck on the for loop. ... I've indicated where it hangs: ...
    (microsoft.public.scripting.vbscript)
  • Re: HELP! Need AD Query for Last login
    ... query the DCs in the USA domain, how would I modify the script? ... I'm new to VB script and making this simple modification is beyond me at ... >> ' Because the lastLogon attribute is not replicated, ... Then, for each Domain Controller, ADO is used to search the ...
    (microsoft.public.scripting.vbscript)
  • Re: Writing Script for ScanDisk and Defrag
    ... *exactly* what is in the script you are scheduling, ... the scheduled task how can I get it to actually run them without needing ... Microsoft PowerShell MVP ... Coming Soon: Windows PowerShell: TFM 2nd Ed. ...
    (microsoft.public.scripting.wsh)