Skip to content

Update MS Graph Connection Handling - #98

Draft
SrBlackVoid wants to merge 3 commits into
jseerden:masterfrom
SrBlackVoid:Update-Connection-Handling
Draft

Update MS Graph Connection Handling#98
SrBlackVoid wants to merge 3 commits into
jseerden:masterfrom
SrBlackVoid:Update-Connection-Handling

Conversation

@SrBlackVoid

Copy link
Copy Markdown

The primary change added here is refactoring the MS Graph connection handling into a centralized function. The way it is structured should allow for different required scopes based on the process being performed.

Also noticed that a couple of the listed scopes may be incorrect:

  • EntitlementManagement was only listed in the Start- functions, nowhere else.
  • There were no ManagedDevice endpoints being called.
  • Scripts was not included, even though device health scripts are being processed

The current changes in this PR also fix that.


Currently marked as a draft because there's still a couple ideas to add here (open to feedback):

  • The backup functions should really only require Read.All scopes. I know it's easier to require ReadWrite.All across the board to ensure parity across all functions, but it does present a potential security risk if the intended usage is simply to perform the backup process, not the restore process.

    • That is where allowing for the different scopes can come into play.
  • Potential hot take: this module shouldn't be trying to automate/fix the connection to MS Graph at all; just checking that the required scopes are there, and exiting out if that is not the case.

Aims to centralize the MS Graph connection process.
Found it odd EntitlementManagement was listed only in the Start-
functions and nowhere else. Ran checks of all called endpoints thru
Find-MgGraphCommand, found that [DeviceManagement]ManagedDevices was
also incorrect; it should be Scripts.
@SrBlackVoid
SrBlackVoid force-pushed the Update-Connection-Handling branch from c5de233 to 8606395 Compare March 15, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant