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:
Exported the configuration file from source tenant using Export-M365DSCConfiguration -Components @("AADGroupsNamingPolicy") -Credential $Credential with no issue.
Compile the configuration file using .\M365TenantConfig.ps1 -Credential $Credential with no issue.
While the deploying the MOF file [Start-DSCConfiguration -Path C:\M365DSC\AADUser\Source\M365TenantConfig\ -Wait -Force -Verbose] getting above error.
Checklist:
- Update the module.
- Install the WmiNamespaceSecurity
- Restart the WMI service in windows.
In the
.ps1config file, try removing the-ModuleVersionparameter from theImport-DSCResourcecmdlet.