8,330 questions
You can use the OnPremisesSyncEnabled enabled property for that. Here is a sample cmdlet that does the export, add any other properties you are interested in as needed:
Get-MgGroup -Property id,displayName,mailEnabled,securityEnabled,groupTypes,onPremisesSyncEnabled,mail -All | select id,displayName,mailEnabled,securityEnabled,groupTypes,onPremisesSyncEnabled,mail | Export-CSV -nti C:\temp\blabla.csv