You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to export only some roles using the Export-M365DSCConfiguration (AADRoleSetting + a Filter), the filter is not taken into account and all roles will be exported.
The issue seems coming from the MSFT_AADRoleSetting DSCResource and more particularly from the Export-TargetResource function. In fact, the parameter $Filter is not used in the below Cmdlet :
[array]$roles = Get-MgRoleManagementDirectoryRoleDefinition -ErrorAction Stop
Maybe a solution would be to simply replace the above command with (there might be better solutions):
[array]$roles = Get-MgRoleManagementDirectoryRoleDefinition -Filter $Filter -ErrorAction Stop
This is my first issue so don't hesitate if you have any questions, I'm not familiar with the process.. :)
Microsoft 365 DSC Version
1.23.1115.1
Which workloads are affected
Azure Active Directory
The DSC configuration
Example:
$Component="AADRoleSetting"$Filters=@{ AADRoleSetting="DisplayName eq 'Global Administrator'" }
Export-M365DSCConfiguration-Components $Component`-TenantId $TenantId`-ApplicationId $ApplicationId`-CertificateThumbprint $CertificateThumbprint`-Filters $Filters--> This command should return only the Global Administrator role but it will export all roles (as the filter is not used...)
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response
The text was updated successfully, but these errors were encountered:
Kierow
changed the title
AADRoleSetting: -"Filter" parameter doesn't work when using Export-M365DSCConfiguration
AADRoleSetting: "-Filter" parameter doesn't work when using Export-M365DSCConfiguration
Nov 21, 2023
Description of the issue
Hello,
If you try to export only some roles using the Export-M365DSCConfiguration (AADRoleSetting + a Filter), the filter is not taken into account and all roles will be exported.
The issue seems coming from the MSFT_AADRoleSetting DSCResource and more particularly from the Export-TargetResource function. In fact, the parameter $Filter is not used in the below Cmdlet :
[array]$roles = Get-MgRoleManagementDirectoryRoleDefinition -ErrorAction Stop
Maybe a solution would be to simply replace the above command with (there might be better solutions):
[array]$roles = Get-MgRoleManagementDirectoryRoleDefinition -Filter $Filter -ErrorAction Stop
This is my first issue so don't hesitate if you have any questions, I'm not familiar with the process.. :)
Microsoft 365 DSC Version
1.23.1115.1
Which workloads are affected
Azure Active Directory
The DSC configuration
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response
The text was updated successfully, but these errors were encountered: