Skip to content

USGov environment using commercial endpoints #117

Description

@sryanexigo

Version 3.0.1 appears to be using commercial endpoints on a GCC-High tenant. Running Connect-MgGraph with the required scopes and the -Environment 'USGov' flag set appears to be working properly. Running Export-Entra returns the following error:

_processBatchErrors : POST https://graph.microsoft.com/v1.0/$batch
HTTP/1.1 401 Unauthorized
Transfer-Encoding: chunked
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
request-id: 5c0daee1-f06d-4715-8aa9-XXXXXXXXXXXX
client-request-id: 5378b5e0-7559-4673-ae42-XXXXXXXXXXXX
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US
2","Slice":"E","Ring":"4","ScaleUnit":"004","RoleInstance":"MW2PEPF0001409B"}}
Date: Thu, 04 Jun 2026 19:04:59 GMT
WWW-Authenticate: Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize",
client_id="00000003-0000-0000-c000-000000000000"
Content-Type: application/json
{"error":{"code":"InvalidAuthenticationToken","message":"InvalidCloudInstance","innerError":{"date":"2026-06-04T19:05:0
0","request-id":"5c0daee1-f06d-4715-8aa9-XXXXXXXXXXXX","client-request-id":"5378b5e0-7559-4673-ae42-XXXXXXXXXXXX"}}}
At C:\Program Files\WindowsPowerShell\Modules\EntraExporter\3.0.1\Export-Entra.ps1:334 char:13
+             _processBatchErrors -requestErrors $requestErrors -reques ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,_processBatchErrors

Rolling EntraExporter back to version 2.0.7, Export-Entra works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions