Saving credentials for reuse by powershell and error ConvertTo-SecureString : Key not valid for use in specified state December 1, 2023 by Tarik You have to create the password string on the same computer and with the same login that you will use to run it.