Powershell Encrypt password RRS feed

  • Question

  • Hello

         I have use

         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 = ""
    $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,


    • Moved by Bill_Stewart Wednesday, February 14, 2018 7:34 PM This is not a support forum for gallery scripts
    Wednesday, January 3, 2018 12:58 PM

All replies