Firstly, I've dabbled with PowerShell but wouldn't call myself fluent in anything more than simple commands.
What I am trying to achieve is to use an object from the first cmdlet where there are a few pipes in this command.
This is the command, I got this from View Mailbox Sizes and Mailbox Quotas Using Windows PowerShell, it works.
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -notlike "BelowLimit*"} | Select DisplayName,StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round((($_.TotalItemSize.Value.ToString()).Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round((($_.TotalDeletedItemSize.Value.ToString()).Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV "C:\My Documents\Exceeded Quotas.csv" -NoTypeInformation
I am wanting to add to this the set quota's for the mailboxes that are returned, the objects are named ProhibitSendQuota, ProhibitReceiveQuota, and IssueWarningQuota. When I add these object to the select pipe the name comes out but not the value. I am able to get the values if I was to use the command
Get-Mailbox | Select ProhibitSendQuota,ProhibitReceiveQuota,IssueWarningQuota
When I use the command
Get-Mailbox -Identity domain\user | Select Identity,ProhibitSentQuota | Get-MailboxStatistics | Select *
None of the objects from the Get-Mailbox cmdlet are shown, only the objects from the Get-MailboxStatistics are present.
My question is then, how can I use an object that exists in the Get-Mailbox cmdlet after all the other pipes and cmdlets have been added?