Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

AADGroup -Filter -ConsistencyLevel -CountVariable

Open ifinch opened this issue 2 years ago • 3 comments

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

ifinch avatar Nov 23 '23 10:11 ifinch

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.

jagatjb avatar Nov 23 '23 11:11 jagatjb

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 ?

bartvermeersch avatar Jan 22 '24 16:01 bartvermeersch

A similar issue for AADUser: 2430

bartvermeersch avatar Jan 22 '24 16:01 bartvermeersch