简体   繁体   中英

Powershell Get-ADUser select return {}instead of values

When I do a get-aduser followed by a select , some columns returns the value {} (or "Microsoft.ActiveDirectory.Management.ADPropertyValueCollection" when I do an export to CSV file).

The command is the following one:

Get-ADUser -properties * | select Surname,LastName,FullName,DisplayName

And the values returned:

| Surname  | LastName       | Fullname | DisplayName    |
| -------- | -------------- | -------- | -------------- |
| John     | {}             | {}       | John Doe (User)|

Try replacing "LastName" with "GivenName" and "Fullname" with just "Name".

I have tried and for me it works this way.

Get-ADUser "YourSearch" -properties * | select Surname,GivenName,Name,DisplayName

Using this @{N='o';E={$_.o[0]}} and by using the correct names for the attributes I was able to extract the informations I needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM