I am following the book “PowerShell In Depth” and in Credentials topic I found this Line
“When PowerShell performs that encryption, it does so using a locally
stored encryption key. Move the script and password file to another machine and it
won’t work, because the local encryption key will be different”
But when I tried to import the encrypted Password from another server but using the same file(Which was stored on my roaming profile) I can still decrypt the Password.
Thank You Alex.I did not use -Key parameter but still was able to reproduce the Password in plain text that was in encrypted text format(Output of ConvertFrom-SecureString) between machines on same domain.
However the file was stored in my Roaming Profile.
The encryption keys are stored in your user profile, so roaming profiles should be fine cross-machine. There’s also an AD feature called Credential Roaming which can make this work without needing to use roaming profiles.