How do you create a report of all the Teams in a tenant and their SharePoint Online sites? As it turns out, a two-line script does the job. We make the script slightly prettier, but it’s still simple. And because it’s PowerShell, anyone can change the code to make it work the way they want it to.
The Azure Active Directory Group Naming policy generates display names for new Office 365 Groups created by various applications. You can include a prefix or suffix in a group name, The approach taken by email favored prefixes because this gathered all distribution lists together in one place in the GAL. However, prefixes work better with applications like Teams.
It’s easy to create a list of group-enabled SharePoint Online sites using the Get-SPOSite cmdlet. But it’s much more interesting to probe a little deeper to uncover extra information about the group using the GroupId property returned if you specify the Detailed parameter. This post explains a PowerShell script written to examine the possibilities, including how to highlight sites belonging to deleted groups that are kept by retention policies.
How best to add every team in your tenant to the Office 365 Groups Expiration Policy? Well, one way is to check all groups for Teams. Another is to use Get-Team to return the set of teams and process those. But then you should think about how to mark the teams that are in the policy in such a way that you don’t process them again. It’s easy to do this with one of the Exchange Online custom attributes.
One of the great things about Teams is the way that it orchestrates Office 365 resources like SharePoint Online sites. The downside is that a tenant’s valuable SharePoint storage quota might be absorbed by a profusion of Teams. To offset the problem, you can apply lower limits to sites belonging to Teams and the best approach is to use PowerShell for the job.
Every Office 365 group (and team) has a SharePoint site. But how to find the URLs of all the sites used by teams in a tenant. One PowerShell answer came from Syskit, but it’s an old technique and we can do better now by fetching a list of teams in the tenant and then retrieving the URL for each team-enabled group.
The new version of the Teams PowerShell module (0.9.5) supports a Get-Team that’s actually useful because it can return a full list of teams in the tenant. But there’s still some work to do…
Some will tell you that you can figure out what resources an Office 365 Group is connected to by checking the ProvisioningOption property with the Get-UnifiedGroup cmdlet. Well, you can’t. If you want to do something like check for team-enabled groups, you’ll need a different approach.