mapped drives

Welcome Forums General PowerShell Q&A mapped drives

This topic contains 5 replies, has 4 voices, and was last updated by

 
Participant
1 year, 11 months ago.

  • Author
    Posts
  • #61225

    Participant
    Points: 0
    Rank: Member

    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.

  • #61227

    Keymaster
    Points: 1,674
    Helping HandTeam Member
    Rank: Community Hero

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

  • #61242

    Participant
    Points: 0
    Rank: Member

    LOL oh I agree totally.

  • #61278

    Participant
    Points: 0
    Rank: Member

    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.

    • #61287

      Participant
      Points: 255
      Helping Hand
      Rank: Contributor

      Did you try to search for it?

      New-ShortCut

    • #61692

      Participant
      Points: 1
      Rank: Member

      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.

The topic ‘mapped drives’ is closed to new replies.