Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Powershell multi-valued columns rather than rows.

Posted on 2013-12-03
3
Medium Priority
?
285 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 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

721 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