To convert an existing string to a secure string use the following:
$SecurePass = ConvertTo-SecureString $UnsecurePass -AsPlainText -Force
After converting to a secure string, you can use it as a password when create user accounts with New-ADUser or as part of credentials you are passing to a cmdlet.
For more information about working with passwords, secure strings, and credentials see the following TechNet article: http://social.technet.microsoft.com/wiki/contents/articles/4546.working-with-passwords-secure-strings-and-credentials-in-windows-powershell-en-us.aspx
No comments:
Post a Comment