$user = "user" $pass = ConvertTo-SecureString "A" -AsPlainText -Force $drive = "N" $unc = "\\NetDrive\Common" $$ = New-Object PSCredential($user, $pass) ndr $drive FileSystem $unc -Credential $$ -Persist