Forum Discussion
Get-MessageTraceV2 not recognized
Hi begberts,
I can't see any references to environment limitations on learn.microsoft.com, so I can't comment on whether being a government cloud matters in this instance, but if we set that one aspect aside, you can run the following command to check if the eligible RBAC roles your account would need to be a member of in order to see and run Get-MessageTraceV2:
Get-ManagementRole -Cmdlet "Get-MessageTraceV2" -CmdletParameters "StartDate", "EndDate", "SenderAddress", "Status" | ForEach-Object {
Get-ManagementRoleAssignment -Role $_.Name -Delegating $false;
} | Sort-Object -Property RoleAssigneeName, Role | Format-Table -AutoSize -Property Role, RoleAssigneeType, RoleAssigneeName;
The column you're interested in is RoleAssigneeName, where your account would need to be in at least one of the listed roles. As an example of the output, this is what I get for my environment:
As a side note, you've made a syntax error within your $params HashTable, though this doesn't explain the error you're seeing (you'd get a different error if this mattered). DateEndDate should simply be EndDate.
Lastly, Get-Command should only be listing the version imported dynamically by the ExchangeOnlineManagement module as shown below:
Cheers,
Lain
Thank you for the reply.
I found my answer, and it does indeed look like a GCC issue...
"Please note that this timeline applies to our WW environment only and does not affect GCC, GCC-High, DOD, or other sovereign clouds. Timeline for GCC, GCC-High, DoD, and other sovereign clouds will be provided in CY25H2."
Microsoft, if you read this post. PLEASE put a notice at the top of the Get-MessageTraceV2 saying it does not apply to GCC tenants!