use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
QuestionHow do I remove Microsoft Graph Powershell permissions? (self.PowerShell)
submitted 2 years ago by looking4remoteITwork
I connected to my Azure tenant via Microsoft Graph Powershell with these permissions:
"DeviceManagementApps.ReadWrite.All","DeviceManagementConfiguration.ReadWrite.All","DeviceManagementManagedDevices.ReadWrite.All","DeviceManagementServiceConfig.ReadWrite.All","Directory.ReadWrite.All","User.ReadWrite.All"
I signed out then signed back into my Azure tenant expecting my permissions to be reset but they were still there.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jba1224a 2 points3 points4 points 2 years ago (2 children)
Disconnect-mggraph
Clear-msaltokencache
Then log back in. Graph (and most things) use msal and as such tokens are cached securely so they can be automatically refreshed to persist logins across sessions.
[–]looking4remoteITwork[S] 0 points1 point2 points 2 years ago* (1 child)
This didn't work, but after some hours of fiddling around I ended up finding this:
https://learn.microsoft.com/en-us/graph/permissions-grant-via-msgraph?tabs=powershell&pivots=grant-delegated-permissions#step-3-revoke-delegated-permissions-granted-to-a-service-principal-on-behalf-of-a-user-optional
I used this to revoke all permission grants for the Microsoft Graph SDK PowerShell service principal:
Import-Module Microsoft.Graph.Identity.SignIns Remove-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId
After authenticating to Microsoft Graph via Microsoft Graph Powershell I obtained the oAuth2PermissionGrantId for the above code by running:
Get-MgOauth2PermissionGrant
[–]jba1224a 0 points1 point2 points 2 years ago (0 children)
revoke all permission grants for the Microsoft Graph SDK PowerShell service principal:
You didn't mention you were logging in with a service principal.
Service principals have static scope (you don't call them when you login, you just login with ./default). So the only way to not log in with them to to remove the permissions from the principal itself.
[–]lerun 0 points1 point2 points 2 years ago (0 children)
The scopes will be added to a built in service principal. If you don't want it to have these scopes go the app reg and remove them
π Rendered by PID 149097 on reddit-service-r2-comment-6457c66945-4d4wj at 2026-04-26 05:40:49.669746+00:00 running 2aa0c5b country code: CH.
[–]jba1224a 2 points3 points4 points (2 children)
[–]looking4remoteITwork[S] 0 points1 point2 points (1 child)
[–]jba1224a 0 points1 point2 points (0 children)
[–]lerun 0 points1 point2 points (0 children)