Author Posts

January 4, 2017 at 6:52 pm

Hi, is there a way in PowerShell to identify mapped drives for a user and then place shortcuts on the users desktop? Thanks for any help in advance.

January 4, 2017 at 6:53 pm

Well, you could certainly enumerate PSDrive (Get-PSDrive) objects of the FileSystem type, I guess, and look to see which roots where UNCs versus local. And there's an old COM object that can create shortcuts, I think it's part of WShell.

Or, you know, make your users grow up and enter the 21st century. 🙂

January 4, 2017 at 7:00 pm

LOL oh I agree totally.

January 4, 2017 at 11:01 pm

I can list the mapped drives using the following:

 Get-WmiObject Win32_MappedLogicalDisk -computer $computer | select name, providername 

Any ideas on a quick script to use the information it collects and create shortcuts on the users desktop? Believe me I don't want to do this either. Users should know where their data is located.

January 5, 2017 at 1:52 am

Did you try to search for it?


January 11, 2017 at 12:56 pm

There is an excellent article in the Microsoft book Windows 2000 Scripting guide (Page 193) which I have just used specifically for this, via Wscript.Shell. I can post the code here if you can find nothing else.