kic*_*ken 12 powershell active-directory powershell-2.0
我写了以下PS脚本:
Get-ADUser -Filter * -SearchBase 'OU=Users & Computers, DC=aaaaaaa, DC=com' -Properties DisplayName | Export-CSV "ADUsers.csv"
从我可以告诉它应该只返回DisplayName.它返回了一切.问题是DistinguishedName稍后在我的进程中导致截断问题.如何让脚本只返回某些属性?
CB.*_*CB. 11
使用select-object进行expample:
Get-ADUser -Filter * -SearchBase 'OU=Users & Computers, DC=aaaaaaa, DC=com' -Properties DisplayName | select -expand displayname | Export-CSV "ADUsers.csv"
Run Code Online (Sandbox Code Playgroud)
小智 7
这对我也有用:
Get-ADUser -Filter * -SearchBase "ou=OU,dc=Domain,dc=com" -Properties Enabled, CanonicalName, Displayname, Givenname, Surname, EmployeeNumber, EmailAddress, Department, StreetAddress, Title | select Enabled, CanonicalName, Displayname, GivenName, Surname, EmployeeNumber, EmailAddress, Department, Title | Export-CSV "C:\output.csv"
归档时间: |
|
查看次数: |
170559 次 |
最近记录: |