ExecQuery hangs whole script but GetObject is fine

From: Brandon McCombs (bmccombs_at_ma.rr.com)
Date: 02/18/05


Date: Fri, 18 Feb 2005 02:17:08 GMT

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



Relevant Pages

  • Re: ExecQuery hangs whole script but GetObject is fine
    ... Please can you write a small script that attempts this ExecQuery, ... ensure it hangs three times on the rogue machine and works three times ... > 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: Creating Computer accounts in the AD with VBScript
    ... I haven't uset your script but I have used this script ... It seems to show> how to specify a user or group that can join the machine to a domain,> but I am having trouble getting this to work correctly. ... > '* machine account, flags to identify the object as a machine account, ... > '* and create an Access Control Entry that gives the specified ...
    (microsoft.public.win2000.active_directory)
  • Re: Organisation Unit Group Membership
    ... So it might be worthwhile for you to cobble a script or batch file to add ... > a group to an OU, so that any machine account placed into that OU is then ... > member" of that group. ... We have a Windows 2003 RADIUS server, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Organisation Unit Group Membership
    ... > So it might be worthwhile for you to cobble a script or batch file to add ... >> a group to an OU, so that any machine account placed into that OU is then ... >> member" of that group. ... We have a Windows 2003 RADIUS server, ...
    (microsoft.public.windows.server.active_directory)
  • RE: "Dead" Machine Accounts
    ... 'Script will output the machine account that have not changed ... Dim TargetDomain ... Set fso = createobject ...
    (microsoft.public.win2000.active_directory)