PowerShell | Create AD User | Import CSV

Published: 10 February 2019
on channel: InfraFort
715
5

Visit my website for more tech related news and info ! https://www.totaltechstuff.com/

$users = Import-Csv "C:\Users\Administrator\Desktop\users.csv"
Import-Module ActiveDirectory

foreach ($user in $users){
$Password = ConvertTo-SecureString -AsPlainText $user.Password -force

New-ADUser ($user.Name + "." + $user.Surname) -GivenName $user.Name -DisplayName ($user.Name + " " + $user.Surname) -Surname $user.Surname -AccountPassword $Password -Enabled $true -UserPrincipalName ($user.Name + "." + $user.Surname + "@test.local") -Path "OU=Testing,DC=test,DC=local"


$newdn = (Get-ADUser ($user.Name + "." + $user.Surname)).DistinguishedName

Rename-ADObject -Identity $newdn -NewName ($user.Name + " " + $user.Surname)
}


On this page of the site you can watch the video online PowerShell | Create AD User | Import CSV with a duration of hours minute second in good quality, which was uploaded by the user InfraFort 10 February 2019, share the link with friends and acquaintances, this video has already been watched 715 times on youtube and it was liked by 5 viewers. Enjoy your viewing!