Query Mapped Network Drives/Paths
Tasked with Reporting all mapped network drives/paths on each machine prior to the decommisioning of DFS.I'm able to Report Disk and LogicalDisk information, but have not found the right class/object toReport "mapped network drives/paths" on machines.Could anyone point me the right way ?Thx !!!!ESPwww.HornyToads.biz
June 2nd, 2009 11:37pm
Look at DataShift - Drives found on SCCMExpert.com site. http://sccmexpert.com/Download/Download.aspx?Type=MOFhttp://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2009 12:14am
Also note that mapped drives are part of a user's profile and not the system, so no query will be 100% complete until every user logs on to a system and has their mapped drive configuration stored/reported. If a user does not log on, their mapped drive data will not be reported on. Just one of many reasons why mapped drives are evil.
Jason | http://myitforum.com/cs2/blogs/jsandys
June 3rd, 2009 12:53am
A very good utility indeed. I tore apart the VBS and do not believe the classes enclosed are going to meet the "network mapped drive" requirements.ESPwww.HornyToads.biz
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2009 1:25am
Why do you say that? That is one of the main reason why people use it.http://www.enhansoft.com/
June 3rd, 2009 2:26am
Well, all I can say is I used the datashift.vbs for years (that company still is using it) to find all the mapped network drives. It was used for a project to find "who is connected to serverX" during a decommission and replace of ServerX. I know it works. Also used the printer part of the script during a printer migration--to know who to migrate. the local admins worked for a while (until we got Vista, and things changed there; but if you care about that, there's a different routine for local admin).Maybe this will help: http://myitforum.com/cs2/blogs/skissinger/archive/2009/04/21/report-mof-for-sccmexpert-datashift.aspxand/or the Mini Monster MOF Builder has the datashift mof edits for sms_def.mof (the script creates the structure, no configuration.mof edits needed): http://myitforum.com/cs2/blogs/skissinger/archive/2008/10/28/mini-monster-mof-builder.aspxYou might want to just use the drive datashift mof edit and script; the local admin part of the script is only accurate for XP workstations or less, and the local shares is boring (to me--you can get that from a default class in sms_def.mof if you need it). Printers may or may not be useful.Standardize. Simplify. Automate.
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2009 4:57am
I must have missed something. I'll look again.Thanks you everyone for your post. These have been very helpful getting me in the right direction.ESPwww.HornyToads.biz
June 4th, 2009 6:47pm
Hello all-Great post....I've never used any of those Datashift scripts and they look pretty sweet.Just to clarify...to inventory Mapped Network Drives:1. Run DataShift_Drives.vbs on the Site Server...2. Restart sms_executive and site_component_manager Service3. Run datashift_drives.vbs on the clientIs this how it goes?Andrew
Free Windows Admin Tool Kit Click here and download it now
September 25th, 2009 4:52pm
you do not run datashift_drives.vbs on the site server.Well, only if that site server "happens" to be a client anyway, and you want it (as a client) to tell the database about it's network drive mappings.What you need to do it edit (using notepad)inboxes\clifiles.src\hinv\sms_def.mof on each primary site with clients where the clients will run the vbs script. In that sms_def.mof file skip to the end, and paste in the mof edit for the drives piece of datashift. Which, according to the Mini Monster Mof Builder, is this://-----------------------// SMS Expert MOF modifications//-----------------------#pragma namespace("\\\\.\\root\\cimv2\\sms")[SMS_Report(TRUE), SMS_Group_Name("SMX Drives"), SMS_Class_ID("SMXDRIVES")]class SMX_Drives : SMS_Class_Template{ [SMS_Report(TRUE)] boolean Compressed; [SMS_Report(TRUE)] string Description; [SMS_Report(TRUE)] string DeviceID; [SMS_Report(TRUE)] uint32 DriveType; [SMS_Report(TRUE)] string FileSystem; [SMS_Report(TRUE)] uint64 FreeSpace; [SMS_Report(TRUE)] uint32 MediaType; [SMS_Report(TRUE), Key] string Name; [SMS_Report(TRUE)] string ProviderName; [SMS_Report(TRUE)] uint64 Size; [SMS_Report(TRUE)] string VolumeName; [SMS_Report(TRUE)] string VolumeSerialNumber;};At the 10,000 foot level... Client (when a user is logged in, *and* the client has rights to WMI)runs the vbscript to place the data into wmi. You've edited the mof to change the hardware inventory policy. Client get's the new hinv, and will report up the new data that's in WMI, since it now has a policy telling it to do so.Standardize. Simplify. Automate.
September 25th, 2009 5:51pm
Very nice! If users do not have administrator rights, what do you think would be the best way to write the data? wmisecurity.exe?
Free Windows Admin Tool Kit Click here and download it now
September 25th, 2009 6:19pm
I don't know what would be best; I tried (once) to figure out a way, like creating the wmi locations first (as SYSTEM, via"run another program first"), and opening up the WMI permissions to the end user for that specific namespace section, and then a (heavily modified) datashift-drives.vbs to run as the user and populate the (now security opened) wmi namespace. But I never did finish that...If you get a method that works, please share; I can see where some companies would find that procedure to be very useful.Standardize. Simplify. Automate.
September 25th, 2009 10:50pm
Me again! I've been using the Datashift-Drives.vbs and it works great (when runing it manually).Does anyone know of a way to run it from SCCM as SYSTEM (not even sure if it'llwork).I tried the command 'cscript.exe Datashiftdrives.vbs', and it runs successfully from SCCM.Afterwards, I'll force aHardware Inventory, then check the targets Resource Explorer. The Class is there but no Network Drive information (even if the script is run on a system where the current signed on user is local admin).But if Igo to that machine and run the scipt and then run the inventory, it works.Is there something incorrect in the command syntax? or is this just not possible to run successfully via SCCM?Andrew
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2009 12:13am
This is on Windows 7 or Windows 2008, right?http://www.enhansoft.com/
November 12th, 2009 12:23am
Hey Garth-Windows XP and Server 2003.The script works great when run manually. Like...superfast!Just through SCCM, I can't get the desired output.
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2009 12:25am
On the program, what do you have the Run Mode set to? Admin or User?http://www.enhansoft.com/
November 12th, 2009 12:30am
Program runs as Admin \ whether or not a user is signed on.I checked the box that 'Allows users to Interact..."This is the command i'm using: cscript.exe DataShift-Drives.vbs
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2009 12:37am
Mapped drivers are specific to each user and are not shared or part of the entire systemin any way. Thus, inventorying the mapped drives of the SYSTEM account results in no drives because the SYSTEM account does not have any mapped. You must run this script as the user whose mapped drives you would like to map.Jason | http://myitforum.com/cs2/blogs/jsandys | http://blogs.catapultsystems.com/jsandys/default.aspx | Twitter @JasonSandys
November 12th, 2009 1:12am
Jason it right, it will not inventory mapped drives of a users when run in Admin mode. (However, It will get you the info for the local drives.)
If you need the mapped drivers then you need to change the Run Mode to User, then everything will be ok. http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2009 2:37am
Thanks guys!!!
November 12th, 2009 4:03pm
Sorry to dig this old thread up, but I'm looking at running the DataShift-drives script to return mapped drive data and am confused as to how are people are getting the data into WMI when the script requires the user to be a local admin to get the data
into WMI, which by default, 'autenticated users' aren't able to do.
Free Windows Admin Tool Kit Click here and download it now
October 22nd, 2010 11:05am
Although I have not done this, you could change the permission on that WMI class to allow “users” the rights to “add/delete” from that class.
This would mean it was a two stage process.http://www.enhansoft.com/
October 22nd, 2010 1:42pm
Can I ask how those that have deployed this script managed to get round the permissions issue? It seems to me reading the thread and other threads on the subject that many people have successfully deployed it and are returning the data, but without changing
WMI permissions, the thing won't work!!!
Free Windows Admin Tool Kit Click here and download it now
October 22nd, 2010 4:34pm
To my knowledge no one has made this work without requiring Admin access or without a two-step process.
http://www.enhansoft.com/
October 23rd, 2010 7:23pm