While deploying the DSC configuration I am getting below error:

InvalidOperation: The PowerShell DSC resource MSFT_AADGroupsNamingPolicy from module <Microsoft365DSC,1.23.726.1> does not exist at the PowerShell module path nor is it registered as a WMI DSC resource.

Checklist:

  1. Exported the configuration file from source tenant using Export-M365DSCConfiguration -Components @("AADGroupsNamingPolicy") -Credential $Credential with no issue.

  2. Compile the configuration file using .\M365TenantConfig.ps1 -Credential $Credential with no issue.

  3. While the deploying the MOF file [Start-DSCConfiguration -Path C:\M365DSC\AADUser\Source\M365TenantConfig\ -Wait -Force -Verbose] getting above error.

Checklist:

  1. Update the module.
  2. Install the WmiNamespaceSecurity
  3. Restart the WMI service in windows.
1

There are 1 best solutions below

0
Nik Charlebois On

In the .ps1 config file, try removing the -ModuleVersion parameter from the Import-DSCResource cmdlet.