In the Select statement I want to be able to display the Alias instead of just the Identity. (The $Alias would have been retrieved as part of the “Get-Mailbox -ResultSize Unlimited”)
Joel, Thanks for the input.
I was hoping for something along those lines, but just putting in the ALIAS at the end does not work.
Its not part of the fields that can be selected.
Try it in exchange and you will see what I mean.
I don’t think you can select a property of the mailbox object because it is no longer what’s in the pipeline by the end.
You could try collecting the mailboxes into a variable first, then doing a foreach as below to get your identity property from the mailbox permission object, and pull the alias off of the current iteration of mailbox in the foreach loop:
$mb = Get-Mailbox -resultsize unlimited
foreach ($item in $mb) {
Get-MailboxPermission $item.Identity | where {$_.user -like "*Testing*"} | select identity,@{l="Alias";e={$item.alias}}}