Today I am going to show you how to use PowerShell cmdlet to disable TEAM for all users in office 365.

  1. Download the 64-bit version of the Microsoft Online Services Sign-in Assistant from following link.

    https://www.microsoft.com/en-us/download/details.aspx?id=41950

  2. Double-click the msoidcli_64.msc to start install Microsoft Online Services Sign-in Assistant for IT Professionals RTW.

  3. On the License Agreement page, select I accept the terms in the License Agreement and Privacy Statement, click Install.

  4. On the Completed the Microsoft Online Services Sign-in Assistant Setup Wizard page, click Finish.

  5. Enter following PowerShell cmdlet to Install the Microsoft Azure Active Directory Module for Windows PowerShell.
    </p><p>Install-Module MSOnline
    </p><p>
  6. If prompted to install the module from PSGallery, type A and press ENTER.

  7. Enter following PowerShell cmdlet to connect to Azure AD for your Office 365 subscription.
    </p><p>Connect-MsolService
    </p><p>
  8. In the Sign into your account dialog box, type your Office 365 work or school account username, click Next.

  9. In the Sign into your account dialog box, type your Office 365 work or school account password, click Sign in.

  10. If you are using MFA, follow the instructions in the additional dialog boxes to provide more authentication information, such as a verification code.

  11. Make sure there are no errors on the Windows PowerShell prompt.

  12. Using following PowerShell cmdlet to view your available licensing plans.
    </p><p>Get-MsolAccountSku
    </p><p>

  13. To use following PowerShell cmdlets to disable TEAM for all users.
    </p><p>$acctSKU="reseller-account"
    </p><p>$x = New-MsolLicenseOptions -AccountSkuId $acctSKU -DisabledPlans "TEAMS_COMMERCIAL_TRIAL"
    </p><p>Get-MsolUser | Where-Object {$_.licenses[0].AccountSku.SkuPartNumber -eq  ($acctSKU).Substring($acctSKU.IndexOf(":")+1,  $acctSKU.Length-$acctSKU.IndexOf(":")-1) -and $_.IsLicensed -eq $True} |  Set-MsolUserLicense -LicenseOptions $x
    </p><p>

Hope you enjoy this post.

Cary Sun @SifuSun