Closed tbisque closed 1 year ago
Nice PR! I hadn't gotten around to re-testing with Merill's latest release yet. Connect-EntraExporter seemed to cover most exporter functions previously, but it definitely helps to specify the .US endpoint (or others) directly.
One thing I wonder about: would it make sense to grab the GraphBaseUri once (maybe during the initial connection) with -GraphBaseUri "$((Get-MgEnvironment -Name (Get-MgContext).Environment).GraphEndpoint)"
? A global variable for the rest of the script to use might simplify code management and make it a tiny bit faster. Thoughts?
Good thinking @SamErde. I like that approach better than mine. I can get that added.
Thanks @tbisque for the PR and @SamErde for the suggestion to optimise. I've tweaked the code with the suggestion from @SamErde
The latest module is being deployed to the gallery and should work well with the gov clouds.
Overview
Export-Entra
does not seem to support USGov endpoints, or other national cloud endpoints.Connect-EntraExporter Approach
The
Connect-EntraExporter -Environment USGov
is successful, however when running theExport-Entra
with the-Debug
parameter, it appears thegraph.microsoft.com
endpoint is being used.Connect-MgGraph Approach
I also tested with connecting to graph directly (with
-Environment USGov
there as well), butExport-Entra
has the same result. It still attempts to use the .com endpoint.Suggestion
With the new
(Get-MgContext).Environment
, this may be easier to handle this than it was in the past.