使用powershell批量导入AD用户

时间:2022-08-02 21:48:18
  1. 建立文本文档另存为csv文件,注意编码格式,否则导入后是乱码

    使用powershell批量导入AD用户

    使用powershell批量导入AD用户

  2. 使用powellshell命令导入

    Import-Csv -Path E:\users.csv | foreach { new-aduser -name $_.name -SamAccountName $_.samaccountname -GivenName $_.givenname -Surname $_.surname -DisplayName $_.displayname -Path $_.path -UserPrincipalName $_.userprincipalname -AccountPassword  (ConvertTo-SecureString -string  $_.accountpassword -AsPlainText -Force )  -Enabled $true -ChangePasswordAtLogon $false }

   3.查看建立的用户

使用powershell批量导入AD用户

本文出自 “记录点滴技术” 博客,请务必保留此出处http://seawind.blog.51cto.com/6845370/1963593