Instantly share code, notes, and snippets.

Embed
What would you like to do?
OneParameterFunction.ps1
#ConvertTo-SecureString in the function
function CreateUser($Password){
$Secure_String_Pwd = (ConvertTo-SecureString $Password -AsPlainText -Force)
New-ADUser -Name "Tom" -SamAccountName "Tom" -AccountPassword $Secure_String_Pwd
}
CreateUser -Password "tHISIsMySecurePassword!!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment