Hi,
You can use the "OtherAttributes" parameter to set attributes not represented by parameters.
$ADUsers = Import-csv C:\testing\test01.csv
foreach ($User in $ADUsers)
{
$Lastname = $User.EnglishLastName
$Firstname = $User.EnglishFirstName
$department = $User.Department
...
New-ADUser -SamAccountName $Username -UserPrincipalName "$******@test.edu.cn" -Name "$Firstname $Lastname" `
-OtherAttributes @{'extensionAttribute1'=$User.extensionAttribute1;'extensionAttribute2'=$User.extensionAttribute1}
}
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.