使用powershell批量导入AD用户

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用powershell批量导入AD用户相关的知识,希望对你有一定的参考价值。

  1. 建立文本文档另存为csv文件,注意编码格式,否则导入后是乱码

    技术分享

    技术分享

  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.查看建立的用户

技术分享

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

以上是关于使用powershell批量导入AD用户的主要内容,如果未能解决你的问题,请参考以下文章