Comments on: A New Take on The Classic Exchange Mailbox Statistics PowerShell Script https://practical365.com/report-exchange-mailbox-statistics/ Practical Office 365 News, Tips, and Tutorials Thu, 08 Aug 2024 22:06:21 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_297700'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_297700"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/report-exchange-mailbox-statistics/#comment-297700 Thu, 08 Aug 2024 22:06:21 +0000 https://practical365.com/?p=60530#comment-297700 In reply to Chris.

Ta. Script updated in GitHub. I guess all my mailboxes are archive-enabled else I would have hit this issue before.

]]>
By: Chris https://practical365.com/report-exchange-mailbox-statistics/#comment-297697 Thu, 08 Aug 2024 21:35:50 +0000 https://practical365.com/?p=60530#comment-297697 I got the same error with mailboxes that had no Archive. The problem was with the variable $ArchiveMbxSizeGB in line 145:
‘Archive mailbox size GB’ = (“{0} GB” -f $ArchiveMbxSizeGB.toString())

The fix was above at line 133 – set the $ArchiveMbxSizeGB variable to 0 or ” instead of $null as there is no toString() method for a $null value.

Original code at line 133: $ArchiveMbxSizeGB = $null
Working code at line 133: $ArchiveMbxSizeGB = 0

Hope this helps.

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_295378'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_295378"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/report-exchange-mailbox-statistics/#comment-295378 Wed, 12 Jun 2024 21:59:37 +0000 https://practical365.com/?p=60530#comment-295378 In reply to Jeremy.

And same questions that I put to John:

Did the script find any mailboxes to process?
What’s the value of the $Mbx variable?

This is PowerShell, so you’ve got to be prepared to do some debugging if things don’t work as well as expected in your tenant.

Are you running the latest version of the Exchange Online management module (3.5)?

]]>
By: Jeremy https://practical365.com/report-exchange-mailbox-statistics/#comment-295372 Wed, 12 Jun 2024 21:04:41 +0000 https://practical365.com/?p=60530#comment-295372 Mine is throwing the same error as John, in older and newer Powershell versions. $Mbx does show as the last mailbox discovered. In my scenario, there’s only 31 and it throws the error on every mailbox it discovers. The .csv output is empty at the end of the run.

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_295003'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_295003"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/report-exchange-mailbox-statistics/#comment-295003 Tue, 04 Jun 2024 12:13:18 +0000 https://practical365.com/?p=60530#comment-295003 In reply to Ricardo.

Connect-ExchangeOnline supports certificates. See the examoples in https://learn.microsoft.com/en-us/powershell/module/exchange/connect-exchangeonline?view=exchange-ps

]]>
By: Ricardo https://practical365.com/report-exchange-mailbox-statistics/#comment-295001 Tue, 04 Jun 2024 11:48:46 +0000 https://practical365.com/?p=60530#comment-295001 Hi Tony
Thanks for the amazing script. It works like a charm 🙂
Is it also possible to run this script without having to login with my user account. I know that when you use MsGraph you can use a ClientSecret from a registered Application. But can you also do that with the Connect-Exchangeonline Command?

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_291373'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_291373"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/report-exchange-mailbox-statistics/#comment-291373 Fri, 29 Mar 2024 16:27:54 +0000 https://practical365.com/?p=60530#comment-291373 In reply to John.

Did the script find any mailboxes to process?
What’s the value of the $Mbx variable?

I’m afraid that I can’t see the data from your tenant so you will have to do some debugging.

]]>
By: John https://practical365.com/report-exchange-mailbox-statistics/#comment-291372 Fri, 29 Mar 2024 16:11:42 +0000 https://practical365.com/?p=60530#comment-291372 Hi – ran into an issue your script, hoping you can help. here is what I get when I run it. thoughts?

You cannot call a method on a null-valued expression.
At C:\temp\Report-ExoMailboxFolderStats.PS1:138 char:5
+ $MbxReportLine = [PSCustomObject][Ordered]@{
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

]]>