Hello
I have use https://gallery.technet.microsoft.com/scriptcenter/Encrypt-Password-and-use-dd07f253/view/Discussions#content
to encrypt password and connect to office 365 successful ,
1. How to Migrate script to another server ? when I copy all script to another computer and running it then show error
2. How to decrypt password after encrypt the same computer ? and another computer ?
Import-Module MSOnline
$Username = "admin@test.onmicrosoft.com"
$Password = get-content "C:\securepassword.txt" | ConvertTo-SecureString
#$credential = New-Object System.Management.Automation.PSCredential $Username,$Password
$credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $Username,$Password
Connect-MsolService -Credential $credential
Best Regards,