Dear friends,
I'm working on a PowerShell script, trying to create new users in batch from .csv file, where we also have extensionAttributes1 and extensionAttributes2 included. I tested the script from our testing environment and it works well without extensionAttributes. The extensionAttributes are integrated from Exchange setup.exe.
Any idea how we can configure the extensionAttributes into our script so when new users were created, these extensionAttributes will be set together? I tried to define -OtherAttributes but didn't know how to get this work with my script.
Any help is really appreciated!
$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 "$Username@test.edu.cn" `
-Name "$Firstname $Lastname"