Get-AzADServicePrincipal

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzADServicePrincipal Azure PowerShell cmdlet and how to use the Get-AzADServicePrincipal PowerShell command.

Get-AzADServicePrincipal

The Get-AzADServicePrincipal PowerShell command can help you to get the entities from the service principals. Now let’s see its syntax.

Syntax

Below is the syntax of the Get-AzADServicePrincipal PowerShell command.

Get-AzADServicePrincipal
Get-AzADServicePrincipal -DisplayName <String>
Get-AzADServicePrincipal
 -ObjectId <String>

Let’s discuss a few examples of the usage of the Get-AzADServicePrincipal PowerShell command.

Example-1:

You can execute the below Azure PowerShell command to retrieve the entities from the service principals.

Get-AzADServicePrincipal

After executing the above PowerShell command, you will get the output like below

Note: Below is not the complete output. You will get the output like below and many more.

PS C:\WINDOWS\system32> Get-AzADServicePrincipal

DisplayName                                             Id                            
-----------                                             --                            
Marketplace Reviews                                     0182eca8-38a2-434b-ac2a-1a2...
Azure Virtual Desktop                                   01856548-5313-459d-aaca-3e3...
ConnectionsService                                      04017fdb-5cfa-42a8-ada9-d68...
Azure ESTS Service                                      045390c9-3b37-4728-9e06-5a3...
Microsoft Intune AndroidSync                            0576bdf0-4ee7-41c2-95c9-102...
O365 UAP Processor                                      0648e39a-8e69-4ce0-832d-a6f...
Microsoft Mobile Application Management                 06988c54-38c0-41a9-86b7-e4b...
Azure Virtual Desktop ARM Provider                      06b981cc-3487-41af-87a0-74d...
Microsoft Intune                                        07cdec90-00d8-42c7-8569-0a3...
Cortana at Work Bing Services                           08ed7662-7764-45c7-83cf-74a...
Azure AD Identity Governance - Directory Management     098de0a7-87ea-42d1-ba98-abb...
Service Encryption                                      0a66a3e7-d5f2-4c49-8016-ffb...
Network Watcher                                         0acd13cf-3630-4016-b3c0-4c3...
Azure Spring Cloud Resource Provider                    0b0016a0-43c9-445d-980d-300...
Domain Controller Services                              0b060b09-0871-4c2b-86b7-b88...
Diagnostic Services Trusted Storage Access              0d358d14-fc50-4ae8-b574-198...
DeploymentScheduler                                     0d5e438d-fe37-4782-8e22-e99...

You can see the same output below

Get-AzADServicePrincipal

Example-2:

You can get the service principal whose display name is “Microsoft Remote Desktop”.

Get-AzADServicePrincipal -DisplayName "Microsoft Remote Desktop"

After executing the above command, I got the below output

PS C:\WINDOWS\system32> Get-AzADServicePrincipal -DisplayName "Microsoft Remote Desktop"

DisplayName              Id                                   AppId                   
-----------              --                                   -----                   
Microsoft Remote Desktop fe1edfc6-19c1-49ca-9be9-6cf073186a42 a4a365df-50f1-4397-bc...

You can see the output as below
Get-AzADServicePrincipal PowerShell command

Example-3:

You can get the service principal whose Id is “fe1edfc6-19c1-49ca-9be9-6cf073186a42”.

After executing the above command, I got the below output.

PS C:\WINDOWS\system32> Get-AzADServicePrincipal -Id fe1edfc6-19c1-49ca-9be9-6cf073186a42

DisplayName              Id                                   AppId                   
-----------              --                                   -----                   
Microsoft Remote Desktop fe1edfc6-19c1-49ca-9be9-6cf073186a42 a4a365df-50f1-4397-bc...

You can see the output as below

Get-AzADServicePrincipal command

You may also like following the below articles

Wrapping Up

In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzADServicePrincipal PowerShell command and along with that we also discussed how to use the Get-AzADServicePrincipal PowerShell command. Thanks for reading this article !!!