EXCEL 另存为 CSV,,UTF-8
import-csv c:\Users.csv | Foreach {New-ADUser -samAccountName $_.SamAccountName -Surname $_.Surname -GivenName $_.GivenName -Name $_.Name -UserPrincipalName $_.Userprincipalname -DisplayName $_.DisplayName -Description $_.Description -Path $_.Path -Enabled $true -AccountPassword (ConvertTo-SecureString $_.AccountPassword -AsPlainText -force) -passthru -PasswordNeverExpires ($_.PasswordNeverExpires -eq "1")}
表格样本: