Kaffeeundcode
Script Library
PowerShell 01.06.2026

Script Workspace

Get ServicePrincipals

Review the purpose, inspect the code, then test it safely in your own tenant.

126_Get-ServicePrincipals.ps1

<#
.SYNOPSIS
    Listet Enterprise Applications (Service Principals) auf.
    
.DESCRIPTION
    Unterschied zu App Registration: Dies sind die Instanzen im lokalen Tenant.
    Erfordert die Berechtigung 'Application.Read.All'.

.NOTES
    File Name: 126_Get-ServicePrincipals.ps1
    Author: Mattia Cirillo
    Version: 1.0
#>

param()

Connect-MgGraph -Scopes "Application.Read.All"

Get-MgServicePrincipal -All | Select-Object DisplayName, AppId, ServicePrincipalType