Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADRoleSetting: ActivateApprover expects User eventhough Group also posible #2283

Closed
afloca opened this issue Sep 14, 2022 · 0 comments · Fixed by #2309
Closed

AADRoleSetting: ActivateApprover expects User eventhough Group also posible #2283

afloca opened this issue Sep 14, 2022 · 0 comments · Fixed by #2309
Labels
Bug Something isn't working Entra ID

Comments

@afloca
Copy link
Contributor

afloca commented Sep 14, 2022

Details of the scenario you tried and the problem that is occurring

Call Export-M365DSCConfiguration -Components @("AADRoleSetting") for a Role that has a Group set for Approvers

Verbose logs showing the problem

Connecting to {MicrosoftGraph}...✅
[1/1] Extracting [AADRoleSetting]...
|---[1/94] Global AdministratorGet-MgUser : Resource '58a7761f-0793-4088-a63c-d41ca1b3bfee' does not exist or one of its queried reference-property
objects are not present.
At C:\Program
Files\WindowsPowerShell\Modules\Microsoft365DSC\DSCResources\MSFT_AADRoleSetting\MSFT_AADRoleSetting.psm1:230 char:9

  •     $user = Get-MgUser -UserId $Item
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: ({ UserId = 58a7...ndProperty = }:<>f__AnonymousType73) [Get-MgUser_ Get], RestException1
    • FullyQualifiedErrorId : Request_ResourceNotFound,Microsoft.Graph.PowerShell.Cmdlets.GetMgUser_Get

Suggested solution to the issue

Extend Get-TargetResource to also try Get-MgGroup if no valid User found
Extend Set-Target Resource with possibility to use Group Displayname/ObjectID

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

The operating system the target node is running

Version of the DSC module that was used ('dev' if using current dev branch)

'dev'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Entra ID
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants