Skip to content

Instantly share code, notes, and snippets.

@gislig
Last active August 3, 2018 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gislig/0fc2838477794c893a5c58d41f41f90c to your computer and use it in GitHub Desktop.
Save gislig/0fc2838477794c893a5c58d41f41f90c to your computer and use it in GitHub Desktop.
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