Retrieving ALL Azure AD registered applications that Get-AzureRMAdApplication does not return

The Microsoft supplied Get-AzureRMADApplication Powershell cmdlet does not return all applications you can see in the Enterprise Applications and App registrations blades in Azure AD.

In addition, Get-AzureRmAdApplication also does not return information such as:

  • Publisher Name
  • logoUrl
  • tags
  • enabled/disabled status
  • if it is a MicrosoftFirstParty application

So, here’s a custom PS function to help you out: https://gitlab.com/Lieben/assortedFunctions/blob/master/get-azureRMADAllApplications.ps1

It requires a special token generated by my get-AzureRMtoken function to log in.

As usual when using unsupported API’s, be careful!

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
GY Horn
GY Horn
5 months ago

Getting the access token works, via the code you refer to. But then I get this error message:
Invoke-RestMethod : 
401 – Unauthorized: Access is denied due to invalid credentials.
Server Error
 
 401 – Unauthorized: Access is denied due to invalid credentials.
 You do not have permission to view this directory or page using the credentials that you supplied.
 
At C:\Users\Admin\horniam\OneDrive – Horn Identity and Access Management\Documents\TNO\PowerShell\get-azureRMADAllApplications.ps1:34 char:12
+   $res = Invoke-RestMethod -Uri $url -Headers $header -Method POST …
+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo     : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
  + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Last edited 5 months ago by GY Horn
Prasath
Prasath
3 years ago

I get the below error message while trying to run the above scripy. Any ideas please….. At F:\get-azureRMADAllApplications.ps1:36 char:180 + … Applications/$($app.objectId)/Properties?appId=$($app.appId)&loadLogo … + ~ The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks (“&”) to pass it as part of a string. At F:\get-azureRMADAllApplications.ps1:36 char:255 + … go={2}” -Method GET -ErrorAction Stop -ContentType “application/json” + ~ The string is missing the terminator: “. At F:\get-azureRMADAllApplications.ps1:1 char:40 + function get-azureRMADAllApplications(){ + ~ Missing closing ‘}’ in statement block or type definition. + CategoryInfo : ParserError: (:) [],… Read more »