Windows Server 2016-命令行批量导出AD用户列表信息
本章节为大家带来如何通过powershell或ldifde命令行方式导出域用户列表信息,方便大家日常运维工作中使用。
powershell方式导出现有staff目录下所有用户信息列表:
get-aduser -filter * -properties * -searchbase "dc=staff,dc=azureyun,dc=com" |select-object name,samaccountname,givenname,surname,displayname,title,mobile,canonicalname,created,department,distinguishedname,emailaddress,homemdb,mail,mailnickname,memberof,msexchcomanagedobjectsbl,msexchhomeservername,passwordlastset,primarygroup,proxyaddresses,userprincipalname,whencreated,whenchanged,mobilephone,telephonenumber,employeenumber,postalcode,company |export-csv c:\alladuser20190226.csv -encoding utf8 –notypeinformation
ldifde方式导出现有staff目录下所有用户信息列表:
ldifde -f alldbauser.ldf -d "dc=staff,dc=azureyun,dc=com" -r objectclass=user -l "name,samaccountname,givenname,surname,displayname,title,mobile,canonicalname,created,department,distinguishedname,emailaddress,homemdb,mail,mailnickname,memberof,msexchcomanagedobjectsbl,msexchhomeservername,passwordlastset,primarygroup,proxyaddresses,userprincipalname,whencreated,whenchanged,mobilephone,telephonenumber,employeenumber,postalcode,company"