AADGroup -Filter -ConsistencyLevel -CountVariable
Description of the issue
While testing, we found that we cannot search for the onPremisesSyncEnabled attribute like below
$filter = @{AADGroup = "OnPremisesSyncEnabled eq null" } export-M365DSCConfiguration -Credential $creds -Components $componentName -FileName $fileName -path $path -ConfigurationName $configName -Filters $filter
• onPremisesSyncEnabled eq Null • onPremisesSyncEnabled eq ‘Null’ • onPremisesSyncEnabled ne true • onPremisesSyncEnabled eq $null
The only way we have been able to get the filter out through powershell is through the following run
get-mggroup -filter "OnPremisesSyncEnabled ne true" -CountVariable CountVar -ConsistencyLevel eventual
Microsoft 365 DSC Version
1.23.1115.1
Which workloads are affected
Azure Active Directory
The DSC configuration
No response
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response
Be it AADGroup or O365Group or any other components, If filter option can be used for all the conditions, then it will be a gamechanger for us.
This is indeed only a quick patch I'm afraid. We would need startswith to collect all groups starting with a prefix. If you don't want to use consistentcyLevel/count for every filter, would it be a solution to implement two separate parameters -Filters and -AdvancedFilters ?
A similar issue for AADUser: 2430