Create multiple users in AD Windows 2019 with the csv file and Powershell

preview_player
Показать описание
This powershell script will let you create multiple users in different OU from a csv files.

script:
Import-Module ActiveDirectory
foreach ($User in $Users)
{
$UserFirstname = $User.Firstname
$UserLastname = $User.Lastname
$OU = $User.OU
$Description = $User.Description
$Password = $User.Password
New-ADUser -Name $Displayname -DisplayName $Displayname -EmailAddress $PSEmailServer -SamAccountName $SAM -UserPrincipalName $UPN -GivenName $UserFirstname -Surname $UserLastname -Description $Description -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path $OU -ChangePasswordAtLogon $false –PasswordNeverExpires $true
}
Рекомендации по теме
Комментарии
Автор

Good day
Maybe if you're going to post videos like this, Have a look at splatting and learn how to use that, as right now you're effectively typing the same thing twice
additionally put a LINK to your CODE so people don't have to type 50 lines of code from a screen shot/photo/whatever which is very very error prone

BlackV
Автор

Thank you, great work! Very well explained with detail. How do we get attached script?

SmartChannel-