How Can I Create a New Psdrive by Using a Password That Is Not Systemsecuredstring?

Is there a way to create a New-PSDrive by using a password that is a NON- SystemSecured string ?

If the password is "FooBoo" I want to use it as it is...

1 Answer

just use the old net use commmand

PS>net use z: \\server\share Fooboo /user:domain\user
PS>Get-PSDrive -Name Z

Name           Used (GB)     Free (GB) Provider      Root                                CurrentLoc
                                                                                              ation
----           ---------     --------- --------      ----                                ----------
Z                 150,36         49,64 FileSystem    Z:\

Or convert you plain text password to secure-string :

PS>$pass="FooBoo"|ConvertTo-SecureString -AsPlainText -Force
PS>$Cred = New-Object System.Management.Automation.PsCredential('user@domain',$pass)
PS>New-PSDrive -name j -Root \\server\share -Credential $cred -PSProvider filesystem

Name           Used (GB)     Free (GB) Provider      Root
----           ---------     --------- --------      ----
j                                      FileSystem    \\server\share

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest