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

This entry was posted in PowerShell and Active Directory. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s