Skip to content

Instantly share code, notes, and snippets.

@epjuan21
Created March 29, 2022 16:40
Show Gist options
  • Save epjuan21/a92630df1ef6b356e0ef681ca74e8b2e to your computer and use it in GitHub Desktop.
Save epjuan21/a92630df1ef6b356e0ef681ca74e8b2e to your computer and use it in GitHub Desktop.
Crear Usuarios
Import-Csv .\Users.csv | foreach-object {
New-ADUser `
-SamAccountName $_.SamAccountName `
-UserPrincipalName $_.userPrincipalName `
-Name $_.name `
-DisplayName $_.name `
-GivenName $_.GivenName `
-Surname $_.SurName `
-Company $_.Company `
-Path $_.OU `
-AccountPassword (ConvertTo-SecureString $_.Password -AsPlainText -Force) `
-Enabled $true `
-PasswordNeverExpires $true `
-ChangePasswordAtLogon $false -PassThru }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment