How to identify which Office 365 groups (Unified Groups) have been created by Microsoft Teams and their members.



Update 16 September 2018 -

As per this article by Tony Redmond - Link - the ProvisioningOption property returned by the Get-UnifiedGroup is not a clear indicator for determining whether the Office 365 group was created by Teams or another Office 365 service.

I have decided to leave this article published for reference in case the Microsoft Engineering Team use the ProvisioningOption in the future.


=======================================================

Overview -
This tutorial will take you through the steps on how to use my Group Membership script to provide a report that can be filtered to show you all the Office 365 groups (Unified Groups) in your tenant that have been created by Microsoft Teams, as well as their members.

=======================================================


Pre-requisites -


To run these PowerShell scripts, you must first connect to either Exchange Online.

Follow my tutorials and use my Office 365 PowerShell connection scripts to connect to Exchange Online.

Note - You must have the directory - c:\reports - created prior to running the scripts or edit the $logpath variable in the script that generate the group membership reports.


Configure your PC and connect to Exchange Online - see tutorials below
- How to configure your desktop PC for Office 365 Administration - including MFA - Link
- How to connect to Office 365 and Azure via PowerShell - Link
- How to connect to Office 365 via PowerShell with MFA - Multi-Factor Authentication - Link
- Office 365 and Azure PowerShell Connection Script (Non-MFA) - Download Link
- PowerShell Office 365 Connection Script with Modern Auth (with MFA) - Download Link


Follow these tutorials to become familiar with the script and how to export the results.
Only part 1 is needed for creating reports of groups in Office 365 / Azure -

Part 1 - Scripts for Azure AD and Exchange Online Group Membership - Link
Part 2 - Scripts for Local AD and Exchange Group Membership - Link

Download the Group Membership Pack for Office 365, Local AD and Exchange - Download Link
Note that version 1-1 was updated to include the attribute used to filter for Office 365 groups.


Be familiar with filtering the reports in Excel
These reports are useless if you don't know how to get the information you need.
If you don't really understand how to filter information in csv files in Excel, now is the time to learn.
It is strongly recommended you are comfortable on filtering columns in Excel to get the best results.
I will be providing some tips on some filters to apply to get specific results, but it really is up to you to determine how to apply filters to get the information you need.

For tutorials and info on applying Excel filters, check this link - Link

Now that you are familiar with how to run the scripts to create the reports I will focus on applying filters to get the data on Office 365 groups (Unified Groups).

=======================================================

Script Revision - 
The Group Membership Pack for Office 365, Local AD and Exchange was recently updated to include the attribute needed to determine which groups are Office 365 groups (Unified Groups).
If you haven't already downloaded it, download it here.


Revision -
- Only one file updated - O365-EXO-AllUnifiedGroupsAndRecipients-v1-0 - now version 1-1
- Added new group attribute - GroupIsCreatedByMicrosoftTeams - to identify Office 365 groups created by Microsoft Teams

The image below shows the column used to identify if a groups is created by Microsoft Teams -
GroupIsCreatedByMicrosoftTeams.
The actual Unified Group attribute that is captured and exported in the script is - ProvisioningOption

To identify groups that have been created by Microsoft Teams, I have updated my script to create the new column - GroupIsCreatedByMicrosoftTeams -.

Office 365 groups (Unified Groups) created by users in OWA or Planner do not have a value for this attribute, whereas groups created by Microsoft Teams do have a value for this attribute.

I have tested this on two separate tenancies and they both have the same result, the attribute value starts with 'ExchangeProvisioningFlags:' and have different numbers at the end.

=======================================================

Select the script
- Script Name - O365-EXO-AllUnifiedGroupsAndRecipients-v1-x.ps1

Update and run the script
Please ensure you have updated the script if you are exporting the report to a directory other than c:\reports.
Review the pre-requisites if you need to update script.

Once you have run the script, it will generate a csv report named - AllOffice365UnifiedGroupsAndMembers.csv

Reviewing the report
Open the csv file - AllOffice365UnifiedGroupsAndMembers.csv - It will look similar to the image below -










=======================================================

Applying filters to produce the filtered results you desire.

In this tutorial, we are focusing on the groups created by Microsoft Teams.

The image below shows the column used to identify if a groups is created by Microsoft Teams -
GroupIsCreatedByMicrosoftTeams.














As previously mentioned, only groups that are created by Microsoft Teams have a value for the attribute - ProvisioningOption.
This is displayed in the csv column titled - GroupIsCreatedByMicrosoftTeams

To filter the csv to show only groups created by Microsoft Teams, perform the following -
Click the number 1 on the left side of the spreadsheet.
This will highlight row number one

Next - Click the button - Sort & Filter - Filter

Once filtering is enabled, each column will have an arrow which can be used to apply filters.




To apply a filter to only show groups created by Microsoft Team, simply click the arrow on the column named - GroupIsCreatedByMicrosoftTeams -

















Next, click the ticked box - Select all - this will then deselect all entries.

















Next, click the box - ExchangeProvisioningFlags:xxxx
- Note - Each tenant has a different number code















Now that the filter is applied, you will only see groups that were created by Microsoft Teams.
Note that the arrow in the column GroupIsCreatedByMicrosoftTeams has changed to a filter to show that a filter has been applied to that column.













Once filtered, you can view the following attributes of the Groups and Members.
- GroupDisplayName
- GroupEmailAddress
- PublicOrPrivateGroup
- GroupManager
- GroupIsCreatedByMicrosoftTeams
- MemberDisplayName
- MemberEmailAddress
- MemberUserPrincipalName
- MemberExternalEmailAddress
- MemberType
- MemberIsLicensed

=======================================================

Understanding the data.

- GroupDisplayName - This is the Display Name of the group
- GroupEmailAddress - This is the email address of the group
- PublicOrPrivateGroup - This is whether the group is configured as Public or Private



- GroupManager - This is the manager of the group
- GroupIsCreatedByMicrosoftTeams - If the group is created by Microsoft Team, there will be a value
- MemberDisplayName - This shows the display name of each member of the group










- MemberEmailAddress - This is the email address of each member of the group
- MemberUserPrincipalName - This is the User Principal Name of each member of the group
- MemberExternalEmailAddress - This is the email address of any external members of the group










- MemberType - This is what type the member of the group is
- MemberIsLicensed - This shows if the member has been assigned a license or not.










=======================================================

Congratulations... 
You now know how to identify which Office 365 groups (Unified Groups) have been created by Microsoft Teams and their members.

------------------------------------------------------------------------------

Check out a list of ALL of my tutorials here - Link




No comments:

Post a comment