使用powershell 自动导入AD用户

版权声明:转载请著名原作者和出处 https://blog.csdn.net/wangrui1573/article/details/82866252

在powershell中输入下列命令,CSV文件注意使用UTF8格式编码

Import-CSV 'C:\importuser\WT.csv' |ForEach {New-ADUser -name  $_.'name' -displayname  $_.'name'  -givenname  $_.'name'  -samAccountName $_.'samAccountName' -company $_.company -title $_.'title' -department $_.department  -AccountPassword(ConvertTo-SecureString "123@abc" -AsPlainText -Force) -Enabled $true  }

猜你喜欢

转载自blog.csdn.net/wangrui1573/article/details/82866252