Solved

Powershell multi-valued columns rather than rows.

Posted on 2013-12-03
3
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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