PowerTip: Create a Secure Password with PowerShell

PowerTip: Create a Secure Password with PowerShell

  • Comments 4
  • Likes

Summary: Use Windows PowerShell to make a plain text entry into a secure password. 

Hey, Scripting Guy! Question Is there a way I can use Windows PowerShell and my working script to make a secure string password without using Read-Host?

Hey, Scripting Guy! Answer Use the ConvertTo-SecureString cmdlet:

$MyBoringPassword=”OhThisCouldBeSecure!ButEverybodyIsReadingThisOnTheInternet!”

To convert this to a SecureString, which is typically needed when you create a new user in Active Directory, execute:

$SecurePassword=CONVERTTO-SecureString –asplaintext –force –string $MyBoringPassword

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Nice and helpful tip!!!

  • Nice Article