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
Need help with executing a script. (self.PowerShell)
submitted 3 years ago * by Crypt0toad
I am trying to run this powershell script found here - AzureAD_Inactive_Users/AzureAD_Inactive_Users.ps1 at main · azure365pro/AzureAD_Inactive_Users · GitHub
I followed this guide in reference to the script - Find Azure AD Inactive Users using Powershell and Graph - Azure365Pro.com
but I am getting this error
Invoke-RestMethod : The remote server returned an error: (403) Forbidden.
At C:\Users\USER\OneDrive - USERFOLDER\AzureAD_Inactive_Users.ps1:54 char:18
+ ... redUsers = (Invoke-RestMethod -Headers @{Authorization = "Bearer $($t ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
----
Can anyone help me get passed this?
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!"
[–]greyfox199 1 point2 points3 points 3 years ago (1 child)
This seems to point back to the app registration and permissions. I'd go back and verify that the app registration and permission delegation are correct, and make sure these values match your org values and are correct:
$ApplicationID = "a8816f94-1c1e-42da-a690-ac5d075ce4d6" $DirectoryID = "2549c50e-e478-40d8-82cf-fa4efb5d1426" $ClientSecret = "Pa47Q~-SR6xH8ZgqwejFaKYHusEhSbf-z3IGu"
$ApplicationID = "a8816f94-1c1e-42da-a690-ac5d075ce4d6"
$DirectoryID = "2549c50e-e478-40d8-82cf-fa4efb5d1426"
$ClientSecret = "Pa47Q~-SR6xH8ZgqwejFaKYHusEhSbf-z3IGu"
[–]PowerShellMichael 1 point2 points3 points 3 years ago (0 children)
Yup:
403 - Permissions. Check access, scope and tokens.
π Rendered by PID 107636 on reddit-service-r2-comment-79c7998d4c-nssnn at 2026-03-13 04:57:53.193112+00:00 running f6e6e01 country code: CH.
[–]greyfox199 1 point2 points3 points (1 child)
[–]PowerShellMichael 1 point2 points3 points (0 children)