Add error handling to AAD Get-MgBetaUser and put redundant code into a function #842
Labels
enhancement
This issue or pull request will add new or improve existing functionality
Milestone
💡 Summary
While testing #794 @buidav uncovered an edge case where if you delete a user or move them out of a group while ScubaGear is running, the AAD function Get-PrivilegedUser calls to Get-MgBetaUser can produce errors that prematurely halt the software. Although the probability of this happening is low, it would be good to handle this event gracefully. We also have redundant code that handles calling this graph function and processing it output so it would be good to put that into a utility function.
Implementation notes
This implementation is specific to Get-PrivilegedUser but the assignee should review the Get-PrivilegedRole function to see if similar enhancements are applicable there.
The text was updated successfully, but these errors were encountered: