Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

PowerShell DSC resource MSFT_AADGroupsSettings failed to execute Test-TargetResource functionality with error

Open hmank opened this issue 6 years ago • 2 comments

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

I am running the Assert-M365DSCTemplate, to compare an existing extracted DSC configuration to a tenant.

Assert-M365DSCTemplate -TemplatePath C:\temp\M365DSC\Baseline-Hab\M365TenantConfig.ps1 -Verbose

The account that i'm connecting to the tenant has MFA turned on however I am never prompted with the MFA authentication window.

Verbose logs showing the problem

The command begins to extract and errors out with the below error:

VERBOSE: [HOME]: LCM: [ End Test ] [[AADGroupsSettings]e5f899d1-065e-4b57-b278-bbcbc00d9525] False in 11.9780 seconds. VERBOSE: [HOME]: LCM: [ FAILEDCompare ] Completed processing compare operation. The operation returned False. PowerShell DSC resource MSFT_AADGroupsSettings failed to execute Test-TargetResource functionality with error message: One or more errors occurred.: Federated service at https://msft.sts.microsoft.com/adfs/services/trust/2005/usernamemixed returned error: ID3242: The security token could not be authenticated or authorized. + CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : localhost

VERBOSE: Operation 'Invoke CimMethod' complete. VERBOSE: Time taken for configuration job to complete is 14.79 seconds The environment does not match the template. The following component(s) are not in the Desired State:

Suggested solution to the issue

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

Assert-M365DSCTemplate -TemplatePath C:\temp\M365DSC\Baseline-Hab\M365TenantConfig.ps1 -Verbose

The operating system the target node is running

The operating system the target node is running OsName : Microsoft Windows 10 Pro OsOperatingSystemSKU : 48 OsArchitecture : 64-bit WindowsVersion : 2004 WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 OsLanguage : en-US OsMuiLanguages : {en-US}

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

1.20.909.1

hmank avatar Sep 13 '20 15:09 hmank

@hmak Assert-M365DSCTemplate is deprecated. Please use Assert-M365DSCBlueprint instead. Thanks

NikCharlebois avatar Sep 13 '20 16:09 NikCharlebois

Thanks Nik, the Assert-M365DSCBlueprint works.

hmank avatar Sep 13 '20 19:09 hmank