Forum Discussion
froggothegood
Oct 09, 2025Copper Contributor
The term 'Get-MessageTraceV2' is not recognized as a name of a cmdlet
I am writing a function app to get message delivery status. I have the package defined in requirements.psd1 as such: # This file enables modules to be automatically managed by the Functions ...
VasilMichev
Oct 10, 2025MVP
The way Exchange PowerShell works is by downloading the cmdlet definitions, as per the roles assigned to the current user. Thus, you will not find the Get-MessageTraceV2 cmdlet within the ExchangeOnlineManagement, but within the temporary module created upon connecting, i.e. tmpEXO_y4vgef2c.4jr.
Of course, you also need to check the permissions, for any given cmdlet you can find out which roles are appropriate via:
Get-ManagementRole -Cmdlet Get-MessageTraceV2
In the case of managed identities/service principals, you must that both the API permissions and the Exchange role are assigned. Lastly, Get-MessageTraceV2 is currently not available in GOV or any other instance, apart from the "standard" one.