Categories

Solving partial displays of AD properties

Had an interesting question today. The question concerned displaying the StreetAddress property when its multiple lines like this:

PS> Get-ADUser -Identity dgreen -Properties StreetAddress | fl Name, StreetAddress


Name          : GREEN Dave
StreetAddress : Floor 5
                Buidling 3
                Newboro Square

 

If you try this with format-table instead

PS> Get-ADUser -Identity dgreen -Properties StreetAddress | ft Name, StreetAddress -a

Name       StreetAddress
----       -------------
GREEN Dave Floor 5...

The address is truncated

The answer is to use the –Wrap parameter

PS> Get-ADUser -Identity dgreen -Properties StreetAddress | ft Name, StreetAddress -a -Wrap

Name       StreetAddress
----       -------------
GREEN Dave Floor 5
           Buidling 3
           Newboro Square

And all is good

Leave a Reply