Saturday, December 16, 2023

Check the assigned policies to Application in Azure AD through powershell


  • Install the required Azure AD preview module

Install-Module AzureADPreview

  • Connect to Azure AD with valid credentials -
Connect-AzureAD
  • Obtain the application Object ID

 Get-AzureADServicePrincipal -Filter "DisplayName eq '<<APPLICATION_NAME>>'"

  • Take the ObjectId from the above command result

Get-AzureADServicePrincipalPolicy -id  <<OBJECT ID from the above command>>

  •  Get the policy details

  Get-AzureADPolicy -Id <<ObjectIdOfthe Policy>> |select *