-
Notifications
You must be signed in to change notification settings - Fork 12
Solution GetDirectoryServicePrincipal
Barbarur edited this page Jun 21, 2026
·
1 revision
Solution Code: GetDirectoryServicePrincipal
This report lists the Enterprise Applications (service principals) in your Entra ID tenant, including their sign-on configuration, credentials, owners and granted permissions.
| Column Title | Description |
|---|---|
| Id | Service principal object ID |
| DisplayName | Name of the enterprise application |
| AppId | Application (client) ID |
| ServicePrincipalType | Application, ManagedIdentity, Legacy, etc. |
| AppOwnerOrganizationId | Tenant ID that owns the underlying app |
| AppOwnerOrganization | Internal / Microsoft / Third Party |
| PublisherName | Verified publisher display name |
| ApplicationAudience | Single tenant / Multitenant / Personal, etc. |
| CreatedDateTime | When the service principal was created |
| OwnersTotal | Number of owners |
| Owners | Owner UPNs (or display names) |
| SamlSso | Whether SAML single sign-on is configured |
| ExposesApi | Whether the app exposes OAuth2 permission scopes |
| ReplyUrls | Configured reply/redirect URLs |
| HasWildcardReplyUrl | Whether any reply URL contains a wildcard |
| SecretCount / SecretsValid / SecretExpired / SecretExpiresIn30Days | Client-secret credential counts |
| CertCount / CertsValid / CertExpired / CertExpiresIn30Days | Certificate credential counts |
| AssignmentRequired | Whether user assignment is required to access the app |
| GrantedDelegatedPermissions | Delegated (OAuth2) grants: [Admin/User] Resource (scopes)
|
| GrantedApplicationPermissions | Application role grants: Resource (role)
|
| Remarks | Remarks/errors captured while building the row |
| API | Delegated | Application |
|---|---|---|
| Microsoft Graph | Application.Read.All Directory.Read.All |
Application.Read.All |
| RBAC | Global Reader* | NA |
Global Reader, Application Administrator or Cloud Application Administrator.
This Solution has no parameters.
- Retrieves all service principals in the tenant.
- For each one, retrieves its owners, delegated (OAuth2) permission grants and application role assignments, resolving each resource/role to a readable name.
- Records one row per service principal.
Resource applications and roles are cached during the run so repeated look-ups of the same resource (e.g. Microsoft Graph) are only fetched once.
Groups
Applications
Sites Collections and Subsites
Document Libraries and Item Lists
Files and Items
Recycle bin
Users
Sites Collections and Subsites
Document Libraries and Item Lists
Files and Items
- Copy or Duplicate files across sites
- Check In files
- Remove file versions
- Restore files from Preservation Hold Library
- Delete files from Preservation Hold Library
Recycle bin
Users
Users