get-adcomputer cannot show full distinguishedname

Ming Cheung 426 Reputation points
2023-03-03T02:16:07.39+00:00

Get-ADComputer -filter * | Select-Object enabled,distinguishedname > D:\ADComputer_20230302.csv

This is my best try, but the distinguishedname still cannot show fully if it is long

I want to export all values to excel, but no matter how, it cannot export all values out, thanks.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2023-03-03T02:58:27.9666667+00:00

    If you want a CSV file use the Export-CSV cmdlet, don't use redirection or the Out-File cmdlet.

    You're not going to export all the properties of the ADComputer object if you only select two properties.

    Post an example of an incomplete distinguishedName.

    If you replace the "-filter *" with just the name of a single computer, and you don't redirect the output to a file, is the "correct" distinguishedName shown on the screen?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.