I have a bat file to map a drive however it's not secure. I have 2 problems, 1st problem is there is SSO on the machine that runs over a generic account and the second problem is the user name has a wrm in front of it but the map drive does not.
I have this so far
Get-PSDrive N |Remove-PS-Drive
$MyCredential = Get-Credential
New-PSDrive –Name “N” –PSProvider FileSystem –Root “\\wrmsfs01\users\$env:username from the get-credential?”
I need a variable that can take off the wrm from the user name and map the drive
This is how I have it in my bat file but I'm trying to convert it to powershell because you will not see the password with $mycredential...
net use N: \\wrmsfs01\users\%var:~3,20%