I need to map a network drive in a workgroup environment to a secure NAS share without using a plain text password.
I'm using a powershell script to create the password in DPAPI and output to a txt file. I now need to map the network drive using the stored DPAPI password.
My powershell script so far is as follows:
# Prompt the user to enter a password
$secureString = Read-Host -AsSecureString "Enter a secret password"
$secureString | ConvertFrom-SecureString | Out-File .\storedPassword.txt