Inventory mapped drives in ConfigMgr 2012

The ability to inventory mapped network drives was a common customer ask in ConfigMgr 2007 and SCCM Expert and some other folks provided free scripts and MOF edits to take care of this. But can this be done in ConfigMgr 2012? 

Mapped network drives and printers are a per-user setting so you need to run a script or process under the user’s context to grab that data and store it somewhere that the hardware inventory process can get to. The obvious place to store the data is WMI. There may be other scripts out there that do this and if you have a better way to do this in ConfigMgr 2012 please let me know, but I chose to use a script provided by CTS for ConfigMgr 2007 and it worked just fine in my lab. Credit to Alvin Morales and JC Hornbeck for the blog article:

https://blogs.technet.com/b/configurationmgr/archive/2008/12/18/configmgr-2007-how-to-inventory-mapped-drives.aspx

Obviously in ConfigMgr 2012 we won't perform the MOF edits shown in the article, we make the change in the ConfigMgr 2012 console itself. But the VB script provided (mapdrives.vbs is what they called it) is required. Given the requirements that need to be met for this to work as a ConfigMgr package (run with user rights, run only when a user is logged on, set it to re-run on a schedule, etc) this may work better as a logon script. You could also modify the VB script to inventory mapped printers as well. You could further modify the script to force a hardware inventory once it’s done, or just wait for the next scheduled inventory to occur.

Once you have created the package and deployed it to your clients, you can verify it worked by using WBEMTEST to connect to root\CIMV2 and look in CX_mappeddrives.

clip_image002

In the ConfigMgr 2012 console you’ll need to add the new class for hardware inventory. So, Administration/Client Settings/Default Client Settings (or select a custom device settings group)/Hardware Inventory/Set Classes. Click Add and use the Connect option to specify a client that now has the information stored in WMI and select the CX_mappeddrives class name.

clip_image003

Once the client has retrieved machine policy and submitted hardware inventory, you should be able to see the mapped drive data in Resource Explorer:

clip_image005

and you can confirm in the database:

clip_image007

Comments

  • Anonymous
    January 01, 2003
    for me it worked fine.  make sure you have forced a hardware inventory cycle after the script runs.  on my test machine i had 4 mapped drives and all showed up.  

  • Anonymous
    January 01, 2003
    Jijo, you mean drives that were mapped but now the drive is no longer available?

  • Anonymous
    January 01, 2003
    Jim, the user would need write access to root/CIMV2. There are probably several ways to do that, one is here:
    https://somethingdifferent.wordpress.com/2014/12/11/how-to-script-dcom-permissions-and-wmi-security-for-non-admins/

  • Anonymous
    September 12, 2013
    I tried and it shows only one mapped drive. I have 6 mapped drives on my test computer. Can you help?

  • Anonymous
    March 26, 2015
    WMISecurity.exe doesn't seem to exist anywhere anymore and the MadOne45's link appears to be dead. I haven't been able to find any new updates/articles on how to do this. Everything seems to loop back or point to finding the WMISecurity.exe file, but CodeProject doesn't show it anymore. :-(