PowerShell script for exporting Group Source from Entra ID

Nidhi Priya 571 Reputation points
2024-07-03T10:54:43.8133333+00:00

Hello experts,

I have to export the group source that the whether the group is cloud or on-prem synced group from the Entra ID using powershell module. Can anyone help me out for the same?

User's image

Looking for a quick reply.

Thanks!

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 123.7K Reputation points MVP Volunteer Moderator
    2024-07-03T15:37:29.64+00:00

    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
    
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.