How can I create a new PSDrive by using a password that is not SystemSecuredString?
Matthew Martinez
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