PowerShell for Windows Admins

Sep 9 2013   12:11PM GMT

Solving partial displays of AD properties



Posted by: Richard Siddaway
Tags:
Active Directory
PowerShell

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

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: