# mapped drives

**URL:** <https://forums.powershell.org/t/mapped-drives/7798>\
**Category:** PowerShell Help\
**Created:** [January 4, 2017, 1:22pm UTC](https://forums.powershell.org/t/mapped-drives/7798 "2017-01-04T13:22:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tony-rodal](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tony-rodal](https://forums.powershell.org/u/tony-rodal)\
**Post date:** [January 4, 2017, 1:22pm UTC](https://forums.powershell.org/t/mapped-drives/7798/1 "2017-01-04T13:22:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [January 4, 2017, 1:23pm UTC](https://forums.powershell.org/t/mapped-drives/7798/2 "2017-01-04T13:23:50Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![tony-rodal](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tony-rodal](https://forums.powershell.org/u/tony-rodal)\
**Post date:** [January 4, 2017, 1:30pm UTC](https://forums.powershell.org/t/mapped-drives/7798/3 "2017-01-04T13:30:42Z")

</div>

LOL oh I agree totally.

---

<div class="post-metadata">

**Author:** ![tony-rodal](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tony-rodal](https://forums.powershell.org/u/tony-rodal)\
**Post date:** [January 4, 2017, 5:31pm UTC](https://forums.powershell.org/t/mapped-drives/7798/4 "2017-01-04T17:31:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [January 4, 2017, 8:22pm UTC](https://forums.powershell.org/t/mapped-drives/7798/5 "2017-01-04T20:22:03Z")

</div>

Did you try to search for it?

[New-ShortCut](https://gallery.technet.microsoft.com/scriptcenter/New-Shortcut-cd0c52c9)

---

<div class="post-metadata">

**Author:** ![archdeacon](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@archdeacon](https://forums.powershell.org/u/archdeacon)\
**Post date:** [January 11, 2017, 7:26am UTC](https://forums.powershell.org/t/mapped-drives/7798/6 "2017-01-11T07:26:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:40pm UTC](https://forums.powershell.org/t/mapped-drives/7798/7 "2024-05-16T20:40:28Z")

</div>

Closed on May 16, 2024, 8:40pm UTC


