I have a powershell script that is run as a scheduled task and is triggered to run "On workstation unlock". The script is programmed to reconnect an SSTP VPN connection if the connection becomes disconnected during the time the workstation is locked. I would like to pass the username and password to the script so that the user is not prompted to enter the same information twice (once for the workstation unlock then again for the VPN connection) The domain username and pass are the same as the vpn username and pass. The [System.Security.Principal.WindowsIdentity]::GetCurrent() will not let me access the password of the currently logged in user. Is there another way??
Thanks