• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1469
  • Last Modified:

Scriptomatic scripts do not return WMI info unless run manually

We use ScriptLogic's Desktop Authority (DA) to collect the hardware and software inventory of all of our PCs on the network. All of our PCs run Windows 7 (x64) with SP1. DA is only showing inventory for a small percentage of our PCs. DA uses WMI to collect the inventory. Their tech support is insisting that the problem is rooted in WMI not working on the PCs that DA is not reporting on. However, I have run multiple .VBS and Powershell scripts with WMI commands that are able to see the WMI data without issue. As a troubleshooting step, tech support asked me to run the Win32_SystemEnclosure script from Scriptomatic 2.0 on one of the problem PCs. When I do this, I get the following output:
==========================================
Computer: PCNAME
==========================================
ChassisTypes:
ServiceDescriptions:
ServicePhilosophy:
TypeDescriptions:

But if I copy/paste this same script from Scriptomatic and create a .VBS file and run it from an elevated cmd prompt, I get the expected output:
==========================================
Computer: PCNAME
==========================================
AudibleAlarm:
BreachDescription:
CableManagementStrategy:
Caption: System Enclosure
ChassisTypes: 3
CreationClassName: Win32_SystemEnclosure
CurrentRequiredOrProduced:
Depth:
Description: System Enclosure
HeatGeneration:
Height:
HotSwappable:

LockPresent: False
Manufacturer: Dell Inc.
Model:
Name: System Enclosure
NumberOfPowerCords:
OtherIdentifyingInfo:
PartNumber:
PoweredOn:
Removable:
Replaceable:
SecurityBreach:
SecurityStatus:
SerialNumber: 1234567
ServiceDescriptions:
ServicePhilosophy:
SKU:
SMBIOSAssetTag:
Status:
Tag: System Enclosure 0
TypeDescriptions:
Version:
VisibleAlarm:
Weight:
Width:

From these tests, I've concluded that there isn't anything wrong with WMI per se but it appears that when a VB script is launched from a Window in Windows 7, that it doesn't have the ability to tie into WMI properly. BTW, I am running Scriptomatic as an administrator when it fails to return the correct results. Does anyone know how to get these scripts to run from the Scriptomatic window (or what would be preventing it from running properly in this case)? Thaniks
0
Marc_Johnson
Asked:
Marc_Johnson
  • 4
  • 4
1 Solution
 
RobSampsonCommented:
Hi, when I run ScriptoMaticV2 on a Windows 7 machine, I create a batch file with this in it:
mshta C:\Temp\Scripts\ScriptomaticV2.hta

and then right click the Batch file, and click Run as Administrator

This allows the code from ScriptoMatic to return values.

Regards,

Rob.
0
 
Marc_JohnsonAuthor Commented:
Rob,

Thanks for your response.

I don't have a problem getting Scriptomatic to run as an admin. I am able to do that by running ScriptomaticV2.hta from an elevated cmd prompt. Since I posted this question, I have come across some new information. I ran Process Monitor while running the script and noticed that the following file is missing on every PC that the script will not run on:

C:\Windows\winsxs\x86_microsoft-windows-wmi-scripting_31bf3856ad364e35_6.0.6000.16386_none_5eda769af5d22759\wbemdisp.dll

Every PC that it runs properly on has this file. I have tried copying this file and registering it using REGSRV32 and rebooting but we still have the problem. My guess is that for the problem PCs, something was installed that did something to wbemdisp.dll which is the main DLL for all things WIM. However, there may be other aspects of WIM that also got changed that I am not aware of. Any idea on how to perhaps "reinstall" or "repair" WMI?

Thanks again.

-Marc
0
 
RobSampsonCommented:
Marc, on a 32 bit machine that file is normally located at
%SYSTEMROOT%\System32\Wbem\WbemDisp.dll

but I'm not 100% sure on a 64 bit system, maybe %SYSTEMROOT%\SysWOW64\Wbem\WbemDisp.dll

I'd have to do some fishing around for a WMI Repair on Windows 7 64 bit....

Regards,

Rob.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Marc_JohnsonAuthor Commented:
The DLL is in both locations but I guess depending on whether a 32- or a 64- process is needed, it'll use the appropriate one?
0
 
RobSampsonCommented:
It should do...perhaps you need to run ScriptoMatic in 32 bit mode?

From an elevated command prompt, navigate to
C:\Windows\System32
and run
mshta "yourHTAFilePath.hta"

Similarly, you may as well try navigating to
C:\Windows\SysWOW64
and run
mshta "yourHTAFilePath.hta"

and see if there's any difference....

Regards,

Rob.
0
 
Marc_JohnsonAuthor Commented:
We finally found out the solution to this after extensive process monitor comparisons between a good PC and a bad PC. We discovered that the following registry key needed to be deleted on the PCs exhibiting this problem:

HKCR\Wow6432Node\CLSID\{D63A5850-8F16-11CF-9F47-00AA00BF345C}

Once this key (and it's subkeys) were removed, the script started working.
0
 
RobSampsonCommented:
That GUID appears to be for the WMI Win32 Provider.  So deleting it probably rebuilds it and repairs it.  Good find.

Rob.
0
 
Marc_JohnsonAuthor Commented:
This was what fixed our issue.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now