Link to home
Start Free TrialLog in
Avatar of Garry Shape
Garry ShapeFlag for United States of America

asked on

Powershell - include relevant columns from other cmdlets?

Working with Powershell in Exchange, but I suspect the principle applies in any other Powershell area as well...

Question is: How can I include the OrganizationlUnit property (or any other property for that matter) from the initial "get-mailbox" output to be carried over as a column alongside the output of the piped "get-MailboxStatistics" cmdlet?

I cannot Select "OrganizationalUnit" or other Get-Mailbox properties with the piped "Get-MailboxStatistics" unfortunately.

Here is the code:

get-mailbox -OrganizationalUnit "cafenet.edu/Employees" -ResultSize Unlimited | Get-MailboxStatistics | Sort-object TotalItemSize -descending | Select DisplayName,@{label="TotalItemSize MB";expression={$_.TotalItemSize.Value.ToMB()}}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Garry Shape

ASKER

Ty!