Retrieving all Azure AD cloud only groups using the Microsoft Graph SDK for PowerShell and the Get-MgGroup
cmdlet.
onPremisesSyncEnabled
https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties
‘true’ if this group is synced from an on-premises directory;
‘false’ if this group was originally synced from an on-premises directory but is no longer synced;
‘null’ if this object has never been synced from an on-premises directory (default).
PowerShell Code
Note: This code requires the Microsoft Graph SDK for PowerShell.