Table of Contents
New Versions of the Microsoft Graph PowerShell SDK and Exchange Online Management Module
For those interested in such events, Microsoft released V2.38 of the Microsoft Graph PowerShell SDK on 16 June 2026. You can download V2.38 from the PowerShell Gallery. The new version seems pretty solid and hasn’t caused any problem with scripts since I installed it, which is always a good sign.
Assembly Clashes Continue to Spoil the Party
Microsoft has upgraded the Exchange Online Management module to V3.10 (8 June 2026). Unhappily, the assembly clashes between these two important modules seem to be getting worse.
Running Connect-ExchangeOnline first followed by Connect-MgGraph results in the error shown in Figure 1:
Connect-MgGraph: InteractiveBrowserCredential authentication failed: Method not found: '!0 Microsoft.Identity.Client.BaseAbstractApplicationBuilder`1.WithLogging(Microsoft.IdentityModel.Abstractions.IIdentityLogger, Boolean)'.
Running Connect-MgGraph first and then Connect-ExchangeOnline generates an error where this sequence used to work:
Error Acquiring Token: System.NullReferenceException: Object reference not set to an instance of an object.
In a nutshell, it’s no longer possible to run the latest versions of the Microsoft Graph PowerShell SDK and the Exchange Online management module in the same PowerShell session. That’s a ridiculous situation for Microsoft to be in. I hope someone fixes this issue soon because the internal finger pointing has gone on for far too long.
As you probably know, the Microsoft Graph PowerShell SDK is a monster composed of 38 sub-modules and 27,750 cmdlets (for V2.38). No one can be expected to know all the cmdlets, and I suspect that most of the work done with the SDK is via a small set of cmdlets like Get-MgUser, Get-MgGroup, Get-MgDevice, and so on. I certainly don’t go looking for new cmdlets to use unless I need to.
Get-MgUserByUserPrincipalName
Last week, I discovered the Get-MgUserByUserPrincipalName and Get-MgUserCount cmdlets. My first thought was to wonder why these cmdlets exist. After all, the Get-MgUser cmdlet is quite happy to take a user principal name as an identifier, and the two cmdlets generate identical output:
Get-MgUser -UserId Kim.Akers@office365itpros.com DisplayName Id Mail UserPrincipalName ----------- -- ---- ----------------- Kim Akers (She/Her) d36b323a-32c3-4ca5-a4a5-2f7b4fbef31c Kim.Akers@office365itpros.com Kim.Akers@office365itpros.com Get-MgUserByUserPrincipalName -UserPrincipalName Kim.Akers@office365itpros.com DisplayName Id Mail UserPrincipalName ----------- -- ---- ----------------- Kim Akers (She/Her) d36b323a-32c3-4ca5-a4a5-2f7b4fbef31c Kim.Akers@office365itpros.com Kim.Akers@office365itpros.com
I played with the Measure-Command cmdlet to see if Get-MgUserByUserPrincipalName is faster than Get-MgUser when using a user principal name to fetch a user account. But it’s not. At least, not in a discernible way that makes much of a difference in practice.
Get-MgUser is a more powerful cmdlet because it supports retrieval of multiple accounts, filtering, and so on. Get-MgUserByUserPrincipalName has a single purpose. The cmdlet works, but how often it is used is the question.
Get-MgUserCount
Get-MgUserCount also seems like an odd cmdlet. It returns an integer value for the count of user objects without fetching the objects themselves:
$Accounts = Get-MgUserCount -ConsistencyLevel Eventual $Accounts = Get-MgUserCount -Filter "country eq 'Ireland'" -ConsistencyLevel Eventual
Until now, I might have found the count for a set of user objects with code like this:
$Accounts = (Get-MgUser -Filter "country eq 'Ireland'" -Property Id -All).count
This Get-MgUser command fetches one property per account and paginates through all available pages, so it’s got more work to do. As such, Get-MgUser is slower than Get-MgUserCount, when all you want to do is count user objects. But it’s only slower by a little in my (small tenant) and often Get-MgUser is the right choice to use as in the situation where a script fetches some accounts and wants to report how many accounts it will process. In larger tenants, I suspect that Get-MgUserCount might be more useful.
A Voyage of Discovery
One of the nice aspects of PowerShell is that there’s always something new to learn. The downsides of managing assembly clashes and the like (or rather, complaining to Microsoft about assembly clashes) are painful and I wish they would go away. But the world is imperfect and we live in the patient expectation that the next version of the software will fix everything. Hasn’t that always been the way?
The nice thing about generative AI tools is that they can generate information based on what’s gone before. The bad thing about generative AI tools is that they can’t create new thinking or insights about how technology works (or doesn’t). When we write the Office 365 for IT Pros and Automating Microsoft 365 with PowerShell eBooks, we depend on hundreds of years of real-world experience, knowledge, and intuition to analyze and explain how Microsoft 365 really works. If you understand the basic principles about Entra ID, Exchange Online, SharePoint Online, Teams, the Microsoft Graph, and more, you’ll be able to figure out the value of new features as Microsoft adds them to the platform. All for less than ten copies of black coffee.

