Solved

Powershell multi-valued columns rather than rows.

Posted on 2013-12-03
3
276 Views
Last Modified: 2013-12-03
I have this command which works great but instead of adding this in one row I would rather for it to have its own column and line up accordingly.

get-recipient -resultsize:unlimited | where {$_.emailaddresses -match "someuser@contoso.local"} | select name,@{Name="emailaddresses";Expression={$_.emailaddresses}} |
0
Comment
Question by:techdrive
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39692751
Try this code and see if it works for you..
Get-recipient -resultsize:unlimited | 
 where {$_.emailaddresses -match "someuser@contoso.local"} | % {
  $name = $_.Name
  $_.emailaddresses | Select @{N="Name";E={$name}},@{N="emailaddresses";E={$_}}
}

Open in new window

0
 

Author Comment

by:techdrive
ID: 39692808
Perfect I JUST CHANGED -MATCH TO -like and it works. Thanks a million man wish I had your brains when it comes to powershell.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39692819
I don’t think it’s a rocket science.. you can learn it.. :-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article shows how a content item can be identified directly or through translation of a navigation type. It then shows how this information can be used to create a menu for further navigation.
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now