Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M365DSCDRGUtil: BaseUrl is empty since MSCloudLoginAssistant removed Intune workload #4057

Closed
ricmestre opened this issue Dec 16, 2023 · 4 comments · Fixed by #4058 or #4074
Closed

Comments

@ricmestre
Copy link
Contributor

Description of the issue

The cmdlets mentioned at the bottom need to query Graph and to construct the endpoint URI they rely on getting the BaseUrl from MSCloudLoginAssistant, nevertheless it tries to get that URL from the Intune workload which doesn't exist in that module anymore since a couple of releases.

To fix this it needs to be changed to take the URL from the MicrosoftGraph object instead.

New-IntuneSettingCatalogPolicy
Update-IntuneSettingCatalogPolicy
Update-DeviceConfigurationPolicyAssignment

Microsoft 365 DSC Version

1.23.1213.1

Which workloads are affected

other

The DSC configuration

N/A

Verbose logs showing the problem

N/A

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage           : en-US
OsMuiLanguages       : {en-US, pt-PT}

Name                           Value
----                           -----
PSVersion                      5.1.22621.2428
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2428
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@William-Francillette
Copy link
Contributor

This was introduced here but not sure of the context:
79774d2

@ricmestre
Copy link
Contributor Author

ricmestre commented Dec 16, 2023

Other clouds such as AzureUSGovernment or AzureDOD don't use https://graph.microsoft.com, instead in this case they have https://graph.microsoft.us and https://dod-graph.microsoft.us respectively so by hardcoding the BaseUrl to https://graph.microsoft.com your cmdlets wouldn't work on those clouds.

@William-Francillette
Copy link
Contributor

William-Francillette commented Dec 16, 2023

Did a quick search in vscode and could find 82 occurrences of graph.microsoft.com

Would be good to use the MSCloudLoginAssistant variable everywhere

@ricmestre
Copy link
Contributor Author

Maybe we actually shouldn't rely on any var at all, e.g. doing the below works just fine and that's why your cmdlets still work with the var being null. I'll update this PR.

Invoke-GraphRequest -Uri "/beta/deviceAppManagement/mdmWindowsInformationProtectionPolicies"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants