Once I click to submit the query, the HTML app hangs for about 60 seconds, then returns the following error:
Line 587 Char 7 Error: The RPC server is unavailable. Code 0 URL file//C:\WMIscript\wmi_admin.hta
There is no line 587 in wmi_admin.hta, and if I'm not mistaken, it is actually referring to wmiadmin.js
Line 587: this._service[ip].Security_.ImpersonationLevel = 3; // == Impersonate
This is where I'm hitting the error.
I figured it was an issue with the RPC service running as NT Authority\Network Service, so I changed the logon for RPC to reflect the same domain admin user I was running the script as. However, once RPC is restarted with the specified user, the error changes from:
The RPC server is unavailable.
Same line and char and code, however.
I'm a java script newbie, any assistance would be greatly appreciated.
Windows XP Professional SP3, RPC is running, user is a domain admin.
I am trying to scan the DHCP range of my network, but not all of the IPs in the range are in use. So, when the app tries to scan an IP that is not in use, it throws the specified RPC Server Unavailable error.
Is the app scripted to ignore IPs from which there is no response?
I wish I knew java script better, but unfortunately I wouldn't know how to go about scripting it so that it will ignore the unused IPs in the specified range.
If I directly query an IP that I know is currently assigned, it works just fine.
I had tried your script. On my local machine it worked fine, but when i tried to run it on a remote machine, it fails. I had used the 'wmi_administrator.htm' to enter user name, password and domain name.
Is there anything else I need to input? Or Is there anything that I have to configure on the remote machine?
When I run the script, I get the 'result-127-0-0-1.xml' file after a couple of seconds but I get no other responce. The file shows 0 length for a while and then goes to 1k. The 'result-127-0-0-1.xml' file is basically empty except for a period.
I'm running it on an XP Pro SP2 machine. Am I doing something wrong?
From looking at the code, I think this will be a great piece of software if I can get it to work.
A section of the code was going out and getting User Account Info.
Since our network node covers all of North America it was taking forever to complete and eventually responded with thousands of User Account returns. I just didn't wait the hours it took for it to do that.
I commented out the call for that routine and, for me, the program now works great.
Well, my use is only for about a hundred out of all those PC's and I'll probably get yelled at for running your script against that whole section of the network. :>)
I don't think a timeout fix would be the answer. It's just that there are so many PC's on our network that it took the script a long time to work its way through all that it found. I'm new here but it's my understanding that there are several hundred thousand PC's in our entire global system and I only hit one small piece of it.
FYI I'm in the process of trying to incorporate your script into a web page on our intranet and having it dump the gathered info into an Access database instead of individual text files.
From there I should be able to generate reports for hardware and software license tracking. Your script doesn't seem to generate license or serial number info for the installed software but I know it's available and can be gathered. I'll figure that out after I get what I already have working.
I've got a web application thats usullay being used on a LAN, but in some places it is being accessed over the internet.
I've got a requirement that the user logon & password is not enough. Because you can give your password to a friend. I need to also log the actual pc that the user used to do his transactions. So all I need is the ASP page to get the MAC address and send it with the transaction.
for the mass storage device type "win32_diskdrive" a new field is available. Since WinXP the field "Signature" was added. This field contains the HD Serial Number (do not confuse this with the Volume ID of the partitions). It's the real hardware vendor serial number.
My first task when creating the script was to create a set of WMI classes useful for periodically (within several days) taking a snapshot of a system(s). That is why, for example, Win32_Fan was not included in Cooling Devices section.
Win32_Services, like any other, rather dynamic, class is useful for constant (several minutes interval) PC health monitoring.
Also mine, but I have a filter that trap and exclude 'normal' services and alerts for 'strange' ones.
Also I'me building a console that (via MSMQ) receive a dump at every startup and verify data with the previous one to identify changes and problems (And also newly installed services). I'll add to this list also the list of running process (like in task manager) to be informed about network evolution..
Very strange. To date, I've noticed the only bug: when running wmiadmin from a directory, whose name contains spaces (for example, C:\Documents and Settings\Dima\) script sometimes fails to create the output file. I guess it is a bug in older versions of Windows Scripting Host.
Anyway, if you wish to supress all output, you can use 'silent' switch. Running
glucks & hasherfrog - thank you guys for comments. All errors are really withing the gatherProsessorInfo() (probably when running the script on a multiprocessor or HyperThreading-enabled machine). The correct routine 'll be in the next post.
great Article! However i've got an error using the script on local computer (XP pro SP2). " Windows Script Host Script: E:\tmp\wmiadmin.js Line: 144 Char: 3 Error: Only one top level element is allowed in an XML document. Code: 80004005 Source: msxml3.dll "
This is the function "xmlAttachChildToParent(parent, child)". The output file "result-127-0-0-1.xml" is empty (0 Bytes). Do you have any Idea how i can make it work? I have admin privileges on local machine.