Getting single mailboxes
When requesting single mailboxes, difference is already notable. When using old Get-Mailbox it took around 450ms (from Finland where I'm performing my tests, over quite bad ADSL line, thanks to my ISP). New Get-EXOMailbox cmdlet returned lightweight mailbox objects around 200ms.
Get-EXOMailbox -Identity pete@phelme.onmicrosoft.com
Old: ~450ms
New: ~200ms
When testing single mailboxes, I was running 2 parallel powershell sessions, old cmdlets with c2r-MFA-capable-EXOService-module and other with new V2 ExchangeOnlineManagement. Note that legacy Get-Mailbox cmdlet in the V2 module is as slow as it is in the old one.
There's major difference in returned payload. With the EXO V2 you only get the minimum set of properties:
More mailboxes
Next bit more challenging query. Show me all your UserMailboxes (out of approx. 22k boxes).
$mailboxes = Get-EXOMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited
Old: 350675ms (5 min, 50 sec)
New: 115325ms (1 min, 55 sec)
It IS faster. Both returned same set of items, just under 18k mailboxes.
Mailbox Statistics
How about the most expensive one, mailbox statistics. Let's get statistics for first 1000 mailboxes.
$stats = $mailboxes | Select -f 1000 | Get-EXOMailboxStatistics -ErrorAction Continue
Old: 480486ms (8 min)
New: 477638ms (7 min, 57 sec)
No notable improvement there. Of course you'll be saving memory, only most used properties are passed by default when using new EXO V2 module:
Mobile Device Statistics
When running statistics for mobile devices I realized that new V2 module is not surfacing errors even if I define -ErrorAction "Continue" in the cmdlet. It just goes on as if all's good. Actually Get-EXOMobileDeviceStatistics doesn't raise errors at all for missing statistics. Might be by design though.The old one is writing out errors as expected:
And how about the speed? A bit faster, saves you 20%.
$mobilestats = $mailboxes | Select -f 1000 | Get-EXOMobileDeviceStatistics
Old: 7 minutes
New: 5 min 19 sec
Mobile stats in module V2 gives larger set by default:
Session lifetime
I was surprised that module V2 renewed session automatically when old module just prompted for new credentials.So, based on first runs it's good, it's faster. It's lighter. Reliability remains to be seen. When testing cmdlets in your own tenant you might experience totally different performance for better or for worse.
Keep on scripting, see you!
No comments:
Post a Comment