Link to home
Start Free TrialLog in
Avatar of Kati Dougherty
Kati Dougherty

asked on

How can I hide my password in the PowerShell script cmdlet used to migrate users to Exchange Online?

PowerShell Cmdlet to Migrate User to Exchange 2013 Online:

How can I hash my password (shown here as Pass123) in this cmdlet?

$cred = New-Object System.management.automation.PSCredential "kati.3dougherty@twdc.onmicrosoft.com", (convertTo-SecureString "Pass123" -AsPlainText -Force)
$cred1 = New-Object System.management.automation.PSCredential "wdw\3dougk035", (convertTo-SecureString "Pass123" -AsPlainText -Force)
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kati Dougherty
Kati Dougherty

ASKER

We are using an automated script using Task scheduler.
How do we encrypt the password in the DAILY script?

Thanks!
KatiD
I've never tried accessing the file as a different user or scheduled task to see if it could be converted back to a secure string in that scenario, so you'd just have to test.  Create the file to save the encrypted password.
Then run the scheduled task on the same computer to use the file and see if it works.
Thanks FooTech!