通过Powershell命令导出特定AD用户的属性

通过Powershell命令导出特定AD的属性

命令格式如下:

Get-ADUser -filter * -SearchBase ‘OU=小OU,OU=大OU,DC=域名,DC=com或local’ -Properties * | Where-Object {$_.Enabled -eq $True} | select SamAccountName,Displayname,Department,Title,Office,Officephone,Mobile,Homepage,EmployeeID,Mail,ExtensionAttribute1,ExtensionAttribute2,ExtensionAttribute3 | export-csv c:\aduser.csv

其中“Where-Object {$_.Enabled -eq $True}”是用于过滤禁用的AD账号,这样就就不会导出的列表里了。

注:AD常用属性
SamAccountName登录名
Displayname显示名称
Department部门
Title职称
Office办公室
Officephone办公室电话
Mobile手机
Homepage
EmployeeID员工工号
Mail邮箱地址
ExtensionAttribute1自定义属性1
ExtensionAttribute2自定义属性2
ExtensionAttribute3自定义属性3

猜你喜欢

转载自blog.csdn.net/u013956462/article/details/107203470