PowerShell script for exporting Group Source from Entra ID

Nidhi Priya 451 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!

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,592 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,100 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 108K Reputation points MVP
    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 Answers by the question author, which helps users to know the answer solved the author's problem.