Solved

Powershell multi-valued columns rather than rows.

Posted on 2013-12-03
3
283 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

IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

Question has a verified solution.

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

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

622 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