title: In PowerShell, how can I combine the results of two commands that have a 1-to-1 relashionship?
body: <p>This particular example is Get-User and Get-Mailbox (Exchange 2010). Get-User returns some of the columns I need, and Get-Mailbox some others. I am having difficulty figuring out how I can combine the results of the two into a single table with the results from both.</p>
  
  <pre><code>Get-User -Filter "..." | Get-Mailbox -Filter "..."
  </code></pre>
  
  <p>How do I take the results of a command similar to the above and turn it into results similar to below?</p>
  
  <pre><code>FirstName  LastName  Alias   CustomAttribute1
  ---------  --------  ------  ----------------
  Bob        Smith     bsmith  Example
  Johnny     NoMail
  Adam       Blye      ablye   Has a Mailbox
  </code></pre>
  
  <p>Note that FirstName and LastName are not returned by Get-Mailbox, and conversely Alias and CustomAttributes are not returned from Get-User. Not every user has a mailbox, so sometimes a portion of the columns would be null. But I'm having a devil of a time figuring out the best way to return a combined table like this.</p>