We help IT Professionals succeed at work.

Issue with SCCM 2012 R2 and WMI Query

Medium Priority
Last Modified: 2019-10-25
I am using an article I found (https://tcsmug.org/blogs/sherry-kissinger/316-configmgr-inventory-per-user-network-printer-mapped-information-datashift-replacement)  to use a VBscript to create WMI classes, and populate them, with a list of the logged in users mapped network drives.

The query works three of my Windows 10 machines, but not the other seven. The OS is Windows 10, 1803 in all cases.

Any suggestions would be appreciated.
Watch Question

Jane UpdegraffSr. Systems Administrator

Your link is dead, I'm afraid. Perhaps the suddenly increased number of hits locked up that blog page. Do you have any other description of the script or can you paste it here?

Stab in the dark, though ..... I would suspect that the script writer may have had very exact definitions for Windows builds because ... for instance ... if the script was written when 1709 was the most recent build number, then none of the newer build numbers would be detected by the script. But that's obviously just a guess, since I haven't seen the script or instructions.
Andrew Duffy-PeterSolutions Architect


This is one from Microsoft Technet. https://blogs.technet.microsoft.com/breben/2013/08/26/inventory-mapped-drives-in-configmgr-2012/ 

The article from the first link is attached.

The two articles have different approaches to the problem, but they both leverage WMI. I have tried both processes, and they work on three computers, but none of the others I have tested. All the same build, Windows 10 Pro 1803, but they may have different patch levels.

The process is, create WMIobjects, populate WMIObjects with data, read data from WMIobjects and enter in SCCM 2012 R2.
The failure occurs on the 2nd step. The script executes with no errors, but fails to populate the WMIobject data values.
Mike TLeading Engineer

Hi Andrew,

Have you checked that the 7 machines definitely create the custom WMI class?
If you want to conrm the data is there, look in root\CustomCMClasses  (not root\cimv2) for cm_MappedPrinters

Are the machines the same OS build - not "W10 1803" but rather were they built using the same build process, and completed the build normally (so not semi complete) and work normally without any other problems?

I guess the 10 machines are in the same collection and all run the job - have you checked the Hardware Inventory log?

Solutions Architect
I got this working. It required a combination of both of the scripts, but it now works flawlessly.

Thank you.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.