要导出AD中的用户信息方式有不少种,我认为最简单的方式是使用powershell命令。shell
可使用PowerShell中的Get-ADuser命令进行导出。ide
如下命令能够导出用户的名字,上次登陆时间,上次密码重置时间,邮件并以CSV格式保存。it
Get-ADUser -Filter * -Properties * -SearchBase " dc=superdoor,dc=co, dc=nz"|Select-Object Name, lastlogondate, passwordlastset, mail | Export-Csv -Path "c:\userinfo.csv"
若是只须要导出某一个OU下面的用户,加上对应的OU便可,OU内部有层级关系,再加上下面的OU便可。io
Get-ADUser -Filter * -Properties * -SearchBase "ou=nation dc=superdoor,dc=co, dc=nz"|Select-Object Name, lastlogondate, passwordlastset, mail | Export-Csv -Path "c:\userinfo.csv"