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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like