Quick post this afternoon on how to install the Microsoft Teams PowerShell Module. The latest version in the PowerShell Gallery at the time of writing this post is 0.9.5. More info on this module can be found at https://www.powershellgallery.com/packages/MicrosoftTeams/0.9.5
You should be running PowerShell Version 3 or greater to install the Teams Module. You can check your PowerShell Version by entering the following variable:-
1 |
$PSVersionTable.PSVersion |
To install the Microsoft Teams Module, run:-
1 |
Install-Module -Name MicrosoftTeams |
Press “Y” when prompted to Accept installing the module from an untrusted repository
Thats it! Before you can call any cmdlets, you will need to call the Connect-MicrosoftTeams cmdlet:-
1 2 |
$Credential = Get-Credential Connect-MicrosoftTeams -tenantid <tenant-id> -Credential $Credential |
*HINT* To find your Office 365 tenant ID in the Azure AD portal
- Log in to Microsoft Azure as an administrator.
- In the Microsoft Azure portal, click Azure Active Directory.
- Under Manage, click Properties. The tenant ID is shown in the Directory ID box.
If you are connecting with a Global Administrator, you should see a successful connection
UPDATE 29/10/18
Use the variable “TenantDomain” for an easier alternative to finding the Tenant ID”
1 |
Connect-MicrosoftTeams -tenantdomain <tenant>.onmicrosoft.com -Credential $Credential |
Go ahead and use the cmdlet we all use first “Get-Team” 🙂
Other available cmdlets for this module are:-
Add-TeamUser Get-Team Get-TeamChannel Get-TeamFunSettings Get-TeamGuestSettings Get-TeamMemberSettings Get-TeamMessagingSettings Get-TeamHelp Get-TeamUser New-TeamChannelNew-Team Remove-Team Remove-TeamChannel Remove-TeamUser Set-TeamFunSettings Set-TeamGuestSettings Set-TeamMemberSettings Set-TeamMessagingSettings Set-Team Set-TeamChannel Set-TeamPicture Connect-MicrosoftTeams Disconnect-MicrosoftTeams