Tutorial: How to create and manage Microsoft Teams via PowerShell?

Tutorial: How to create and manage Microsoft Teams via PowerShell?

The Microsoft Teams PowerShell module provides an answer to be able to run scripts or change policies via the non-graphical view of the Administrator panel. Sometimes this is a practical solution to make changes quickly in one go. (bulk changes) OR to modify settings that have not yet been made available to everyone in the graphical interface or via the Teams control panel. https://admin.teams.microsoft.com

Open Powershell as administrator

1

Install Microsoft's PowerShell module Teams

Run the following line in PowerShell:

Install-Module MicrosoftTeams

Connecting to PowerShell

Import-Module MicrosoftTeams
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
Connect-MicrosoftTeams
1

Enter the username and password of your Global Administrator or Microsoft Teams administrator.

Retrieve Microsoft Teams with PowerShell?

Get-Team
1

Command presets from Teams

Get-Command -Module MicrosoftTeams

Meetingpolicies via PowerShell

Get-CsTeamsMeetingPolicy

Making adjustments to, for example, save meeting recordings on OneDrive instead of Microsoft Stream

Set-CsTeamsMeetingPolicy -Identity global -RecordingStorageMode OneDriveForBusiness

Create a new Microsoft Team

New-Team -DisplayName 'test team'
1

Deleting a Team

Remove-Team -GroupId ebae4935-4654-426e-b49c-7d16372899f8
1

Retrieve a Team with PowerShell

Install the PowerShell module from Azure AD via:

Install-Module AzureADPreview

Connect-AzureAD to connect to Azure Active Directory

Connect-AzureAD
Restore-AzureADMSDeletedDirectoryObject -Id ebae4935-4654-426e-b49c-7d16372899f8
1

The group ID can be found via: Get-Team

Adding Private Channels to a Team

New-TeamChannel -GroupId f98369f6-24d6-4b8d-aa1c-ca5a3e0a94f7 -DisplayName "Internal Communication" -MembershipType Private
New-TeamChannel -GroupId f98369f6-24d6-4b8d-aa1c-ca5a3e0a94f7 -DisplayName "Outside Services" -MembershipType Private
New-TeamChannel -GroupId f98369f6-24d6-4b8d-aa1c-ca5a3e0a94f7 -DisplayName "Financial Services" -MembershipType Private

Adding users to a team

add-teamuser -groupid 4c7de4c1-3b14-46a2-bd30-675de9c080a8 -user Jef@365tips.be
add-teamuser -groupid 4c7de4c1-3b14-46a2-bd30-675de9c080a8 -user dirk@365tips.be
add-teamuser -groupid 4c7de4c1-3b14-46a2-bd30-675de9c080a8 -user Piet@365tips.be

Don't know where to start?

Install get-help!

Get-help
1

Get-help helps!

1

Other useful Teams blogs, here. All portals of Office 365 can be found here.

Jasper

Jasper

Welcome to 365tips.be. On this website you can read articles and experiences about Office 365 with focus on Microsoft Teams. Feel free to ask me a question and I will answer it in a blog post. Help others by giving feedback at the bottom of the articles. This blog is made in Dutch. The multilingual website is offered with best-effort machine translation.
0 0 votes
Product review
Subscribe
Please let us know if there are
guest
0 Reactions
Inline feedbacks
See all comments
0
Would love to know your thoughts, please leave a comment.x