Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

"The following resources cannot be extracted" warning when using certificate authentication

Open mikespolk opened this issue 5 years ago • 1 comments

Details of the scenario you tried and the problem that is occurring

I tried to use certificate authentication during M365 DSC Configuration, with following command:

Export-M365DSCConfiguration -Verbose -Quiet -CertificateThumbprint 123456789012345678901234567890 -ApplicationId 12345678-1234-12334-12343-123456789012 -TenantId tenantname.onmicrosoft.com -Path C:\Temp\ -FileName tenantconfig.ps1 ` -ComponentsToExtract @('IntuneDeviceCompliancePolicyiOs','IntuneDeviceEnrollmentLimitRestriction')

I am having the certificate and its PFX in the Windows logon current user context, as well as has uploaded it to App registrations section in AAD console. From the console, I have retrieved the ApplicationId and TenantId, and applied+adminconsented the DeviceManagementConfiguration.Read.All etc. permissions.

However, I get no data in the tenantconfig.ps1 file. Instead, the following warning message appears:

[WARNING] Based on the provided Authentication parameters, the following resources cannot be extracted: IntuneDeviceCompliancePolicyiOs IntuneDeviceEnrollmentLimitRestriction

It may be worth noting that changing certificate thumbprint characters, results in the same result.

In the eventlog, I get no indication what might be the root cause.

How to correct or further troubleshoot that problem?

Verbose logs showing the problem

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

The operating system the target node is running

Version of the DSC module that was used ('dev' if using current dev branch)

mikespolk avatar Mar 04 '21 11:03 mikespolk

I answer this myself, after realizing the tool behaviour; When running the Export-M365DSCConfiguration command in interactive mode, deselecting the Credentials checkbox and then selecting the Certificate and Application ID checkboxes, grays out part of component checkboxes. That most probably means that the tool cannot extract those components. For example, all stuff in Intune category gets grayed out.

Thus the warning message is quite obvious and just indicates the current tool version capabilities.

Anyway, hope the documentation would be better, so every user might not face the same problems.

mikespolk avatar Mar 12 '21 09:03 mikespolk