I have some scripts which use WMI to get system info of printers, RAM,
serial no., etc...

Right now I want to use 10 copies of each script as there are about
10,000 computers I need to scan and doing the whole lot at once would
take too long, especially if I need a report overnight. So I cut them
up into 10 scripts to run at the same time, hitting 1,000 computers
each, with all 10 scripts being identical except for the computer
names and IPs they read from an excel sheet.

The issue I'm having is that there seems to be a one session limit on
WMI, so I can't run 10 scripts on one computer. The first script runs
fine, the second I run on the same computer just quits after a few
seconds (viewing task manager I see two wscripts, then it goes to
one). Is there a way around the limit, registry hack or something?
Doing a google search got me nothing on this.

Thanks for any help.

Re: Is there a limit on WMI connections from one computer? by Takahe

Takahe
Tue Feb 27 02:41:27 CST 2007

I have successfully had over 8 wmi threads querying different
computers from one master script

I modified the following script http://cwashington.netreach.net/depo/view.asp?index=614&scripttype=vbscript
to run another script with a computer name as a parameter.

Is your 2nd script using the same file\log that could cause the 2nd
instance of your script to fail?

The 8 threads had a good balance for processing power\network
connection. In the good old days it could run a report on over 300
computers in < 10 minutes depending on what we were querying.

Having a ping function make sure that a workstation is there before
connecting via wmi can save you a 30 second timeout to.


Re: Is there a limit on WMI connections from one computer? by lgurevich

lgurevich
Tue Feb 27 12:57:57 CST 2007

On Feb 27, 3:41 am, "Takahe" <michael_menz...@hotmail.com> wrote:
> I have successfully had over 8 wmi threads querying different
> computers from one master script
>
> I modified the following scripthttp://cwashington.netreach.net/depo/view.asp?index=614&scripttype=vb...
> to run another script with a computer name as a parameter.
>
> Is your 2nd script using the same file\log that could cause the 2nd
> instance of your script to fail?
>
> The 8 threads had a good balance for processing power\network
> connection. In the good old days it could run a report on over 300
> computers in < 10 minutes depending on what we were querying.
>
> Having a ping function make sure that a workstation is there before
> connecting via wmi can save you a 30 second timeout to.

I made sure the Excel file it reads from can be opened multiple times,
I open it as "Read Only". Tested that with 3 scripts starting almost
at one time that read the same file, all opened it fine. The log
file, it only has it opened when it writes to it, then closes it.
Chances of both scripts wanting to open it at the same time is small,
and the second script does not even try to connect to a computer, so
it never gets to the log file. I do ping the computers beforehand,
the ping also gives me a visual indicator that the script is working.

I'll take a look at the script you linked to, lots of lines in there
to go through.