Skip to content

Issue with Send-MgUserMail command in GCC High #3567

@SamRobinson83

Description

@SamRobinson83

Describe the bug

I have several automated tasks that when they are finished use the Send-MgUserMail functionality to send alerts. We migrated away from Commercial to GCC High at the end of last year and now the Send-MgUserMail command throws an error when trying to send. The error is the following:

Send-MgUserMail -UserId $userId -BodyParameter $params -Debug
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Remote forest discovery is not supported on restricted forests. Local Forest: NAMP111.PROD.OUTLOOK.COM Remote
     | Forest: NAMP110A003.PROD.OUTLOOK.COM.  Status: 403 (Forbidden) ErrorCode:
     | ErrorTenantNotFoundInCurrentSovereignEnvironment Date:   Headers: Cache-Control                 : private
     | Strict-Transport-Security     : max-age=31536000 request-id                    :
     | 23b60610-8afc-4683-9889-a7365793f1d1 client-request-id             : 865d4788-72d4-417f-99b5-606404ea9872
     | x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"USDoD
     | East","Slice":"E","Ring":"6","ScaleUnit":"000","RoleInstance":"BN3NEPF00005473"}} Date
     | : Wed, 25 Mar 2026 18:26:43 GMT

  Recommendation: See service error codes: https://learn.microsoft.com/graph/errors

Expected behavior

Send-MgUserMail sending an email to the intended users email.

How to reproduce

  1. Connect to GCC High via Graph Powershell
  2. Use the Send-MgUserMail command to send a message

SDK Version

2.36.1

Latest version known to work for scenario above?

No response

Known Workarounds

None

Debug output

Click to expand log ```

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://dod-graph.microsoft.us/v1.0/users/noreply%40vanguard-ems.us/microsoft.graph.sendMail

Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26200; en-US),PowerShell/7.5.4
SdkVersion : graph-powershell/2.36.1
client-request-id : 865d4788-72d4-417f-99b5-606404ea9872
Accept-Encoding : gzip,deflate,br

Body:
{
"Message": {
"subject": "Testing MG Graph Stuffs",
"toRecipients": [
{
"emailAddress": {
"address": "user@domain"
}
}
],
"body": {
"content": "Testing email.",
"contentType": "Text"
}
}
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Forbidden

Headers:
Cache-Control : private
Strict-Transport-Security : max-age=31536000
request-id : 23b60610-8afc-4683-9889-a7365793f1d1
client-request-id : 865d4788-72d4-417f-99b5-606404ea9872
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"USDoD East","Slice":"E","Ring":"6","ScaleUnit":"000","RoleInstance":"BN3NEPF00005473"}}
Date : Wed, 25 Mar 2026 18:26:43 GMT

Body:
{
"error": {
"code": "ErrorTenantNotFoundInCurrentSovereignEnvironment",
"message": "Remote forest discovery is not supported on restricted forests. Local Forest: NAMP111.PROD.OUTLOOK.COM Remote Forest: NAMP110A003.PROD.OUTLOOK.COM."
}
}

Send-MgUserMail_Send: C:\Scripts\Email.ps1:19
Line |
19 | Send-MgUserMail -UserId $userId -BodyParameter $params -Debug
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Remote forest discovery is not supported on restricted forests. Local Forest: NAMP111.PROD.OUTLOOK.COM Remote
| Forest: NAMP110A003.PROD.OUTLOOK.COM. Status: 403 (Forbidden) ErrorCode:
| ErrorTenantNotFoundInCurrentSovereignEnvironment Date: Headers: Cache-Control : private
| Strict-Transport-Security : max-age=31536000 request-id :
| 23b60610-8afc-4683-9889-a7365793f1d1 client-request-id : 865d4788-72d4-417f-99b5-606404ea9872
| x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"USDoD
| East","Slice":"E","Ring":"6","ScaleUnit":"000","RoleInstance":"BN3NEPF00005473"}} Date
| : Wed, 25 Mar 2026 18:26:43 GMT

Recommendation: See service error codes: https://learn.microsoft.com/graph/errors
DEBUG: [CmdletEndProcessing]: - Send-MgUserMail end processing.

</details>


### Configuration

-OS: Windows 11
-Architecture: x64
-Powershell: 7.6

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions