Forum Discussion
Using PowerShell to Check Group or Team Membership
Hi Tony,
I've seen a few of your wonderful scripts to do with Groups and Teams hence I feel you are the best person to ask this. Is it possible via PowerShell to get a list of Teams and what Groups they have residing in them.
I know that within Microsoft Teams, you can add members to a Team, which can be individuals and Groups. It is those groups that were added that I need to see. Is this possible?
Thank you in advance,
Ash
you’re just doing a one time import of the member of those groups. So you’ll probably just see the members being added
- ashokjingarJun 20, 2019Copper Contributor
Thanks for your reply. If you read the following article, TonyRedmond makes a comment that in Azure AD, background synchronisation takes place eventually. Meaning that if you add a new user to a particular Group in Azure AD, that new user should eventually appear in the Team that uses that Group. So that would imply that Teams/Azure AD knows which Groups belong to which Team.
Regards,
Ash
- Jun 20, 2019Yes! There’s always a Office 365 group for every team! But you can’t add another group in the members section! Only add users or groups but it will then only import the users that are members of that group
You should be able to get the underlaying office365 groups for the teams- TonyRedmondJun 20, 2019MVP
adam deltinger Right. The only valid members of an Office 365 group or team are tenant accounts and guest user accounts. Office 365 Groups don't support nested groups, so if you add a group or DL to the membership of an Office 365 group, the membership is expanded and all valid members are added separately to the membership. No connection is kept to the source group.
- TonyRedmondJun 20, 2019MVP
ashokjingar Hold on... an Office 365 group is just a certain kind of Azure AD Group. And a team belongs to an Office 365 group. So if you add members to an Azure AD group that is associated with a team (and by definition, an Office 365 group), then the members will be synchronized to the team too. A team can only be associated with a single Office 365 group (or Azure AD group).