none
PS drive mapping not persist RRS feed

  • Question

  • I am running the following on the powershell prompt (not as an admin) 

     New-PSDrive -Name "X" -PSProvider FileSystem -Root \\servername\sharename\

    the command runs fine with no errors but I do not see the mapped drive any where?

    I can manually map using net use to the above share and that works like a charm!

    Any ideas?

    Thank you


    • Edited by WildPacket Monday, June 24, 2019 5:06 PM
    Monday, June 24, 2019 4:37 PM

All replies

  • This one worked but when I sign out the drive mapping is lost.

    New-PSDrive -Name "S" -Root "\\Server01\Scripts" -Persist -PSProvider "FileSystem"

    Monday, June 24, 2019 4:53 PM
  • Tried the following by adding -Scope Global but dont work


    New-PSDrive -Name "Y" -Root "\\servername\sharename" -Persist -PSProvider "FileSystem" -Scope Global

    Monday, June 24, 2019 5:07 PM
  • New-PSDrive -Name Y -Root \\servername\sharename -Persist -PSProvider FileSystem

    This creates a persistent drive in the account running it.  It does not want to be run in an elevated session.

    All of the quotes are unnecessary.  A persisted drive is global by default.


    \_(ツ)_/

    Monday, June 24, 2019 5:37 PM
  • Thank you JRV.   I tried without quotes but when I sign out and sign back in the drive mapping is gone?
    Monday, June 24, 2019 5:50 PM
  • Then I suspect that Group Policy has been set up to prevent mapping of drives so they will be removed the next time you log into you account.

    \_(ツ)_/

    Monday, June 24, 2019 5:53 PM
  • Thank you jrv. The computer I am on is not on a domain.  I am manually mapping it
    Monday, June 24, 2019 5:57 PM
  • Thank you jrv. The computer I am on is not on a domain.  I am manually mapping it

    So. If GP is getting in then you can't do what you are trying to do.


    \_(ツ)_/

    Monday, June 24, 2019 5:58 PM