Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community

Only list custom created Service Principals

Deleted
Not applicable

For a customer I'm currently in the process of analyzing the impact of migrating several subscriptions to another tenant. Therefore we would also need to recreate several service principals linked to applications that will be moved. 

 

Is there a way to list all of the custom created service principals in a tenant. Or some kind of list of all of the "standard" application IDs (like ones that are used by Microsoft Teams) to be able to already filter out those.

2 Replies

@DeletedYou could use 'az ad sp list --filter' or 'Get-AzureADServicePrincipal -Filter' to start with.

 

Optionally 'Get-AzureADServicePrincipal | ? $_.DisplayName -NotContains 'Microsoft''

@Joni_Nieminen This won't correctly identify the custom ones as when other SaaS applications are connected they also show up here. 

 

Service principals don't seem to have a property like "Custom Created" for example to clearly see the difference with the ones from SaaS apps.

 

If there would be a list with application ID from the major SaaS companies this would also already help to filter the list.