@wrx7m said in PowerShell - Off-boarding Script:
@dafyre said in PowerShell - Off-boarding Script:
@wrx7m said in PowerShell - Off-boarding Script:
@dafyre I think I found where you got it - https://www.powershelladmin.com/wiki/Powershell_prompt_for_password_convert_securestring_to_plain_text
Anyway, I am not sure where, in my script, I should place that function.
You'd put the actual function at the top of your script, and then just
$myPassword=convertFrom-SecureToPlain -securepassword $MySecurePassword
Wherever you need the password in plain text form.
Thanks. It mostly works. The only problem is that it isn't actually using the password I specify at the top. It is somehow generating its own and then writing it at the end. I put in
write-host "Plain Text Says: $plainText"and it shows the password that I typed in for the secure variable at the beginning, followed by the one that it generated.
Plain Text Says: $#@%4#@177 Jof91348
Works fine for me here.... Check and make sure you don't have an extra write-host or anything somewhere.
4a0db1d0-785c-4771-9ad2-9cec6cb0434a-image.png