Service Principal object - How to return Synchronization object

machinevolution-4531 20 Reputation points

I am trying to determine the amount of synchronization configured Service Principals may exist in a tenant.

When interacting with the Microsoft Graph however, I cannot filter on this nor can I seem to retrieve this data from the service principals API although the properties do exist.

$sp = Get-MgServicePrincipal -ServicePrincipalID "{{insert SP GUID here}}" 
# returns empty data
id -- 
IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    MicrosoftGraphSynchronization            System.Object  

$sp.Synchronization | fl *   
Id                   : 
Jobs                 : 
Secrets              : 
Templates            : 
AdditionalProperties : {}

Is there a way to filter synchronization configured service principal data from graph or is the only way to lookup all service principals and then check for a sync jobid?

Ultimately attempting to achieve something like below but for Entra Synchronization

Get-MgServicePrincipal -Filter "preferredSingleSignOnMode eq 'oidc'"
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,051 questions
0 comments No comments
{count} votes