Export (0) Print
Expand All

Disable Office 365 Service Plans with Windows PowerShell


Applies to: Office 365

Topic Last Modified: 2014-11-24

Summary: Describes how to disable service plans from an Office 365 license by using Windows PowerShell cmdlets in the Azure Active Directory Module.

You can use the Azure Active Directory Module for Windows PowerShell cmdlets to disable some or all of the service plans that are included in the license. You can do this for all users or a set of users.

This article contains procedures for how to disable these services plans. For these procedures, we’re assuming you installed the Azure Active Directory Module for Windows PowerShell and that you have a shortcut for it on your desktop. You also have to be a global administrator on your Office 365 tenant. To run the examples in these procedures, open the shortcut and type the commands at the Azure Active Directory Module for Windows PowerShell command prompt.

Don’t have the module installed? See Manage Azure AD using Windows PowerShell for download instructions and cmdlet syntax.

Connect to Office 365 by using Azure PowerShell and get account information
  1. Type Connect-MsolService at the Windows PowerShell command prompt, and enter your global administrator credentials in the dialog box that pops up.

    The dialog box used for credentials.

    After you enter your credentials, you’ll be connected to your Microsoft Online services for as long as the Windows PowerShell command prompt is open.

  2. Before you can change the licenses for any users, you need to verify your plan information. To get this information, use the Get-MsolAccountSku cmdlet. But first, let’s become familiar with the full help for this cmdlet.

    Type help Get-MsolAccountSku -full at the command prompt, and keep pressing Enter until you get to the available outputs. They are:

    • AccountName   The name of the tenant, for example “Contoso.”

    • AccountObjectId   The unique GUID that identifies the account.

    • ServiceStatus   The provisioning status of individual services that belong to this plan.

    • AccountSkuID   The unique string ID of the account for the tenant. This includes the tenant name and the name of the Office 365 plan, for example, “ENTERPRISEPACK.”

    • ActiveUnits   The number of active licenses.

    • ConsumedUnits   The number of licenses that have been assigned to users.

    • ServiceStatus   The provisioning status of individual services belonging to the tenant, for example Lync Online, SharePoint Online, Exchange Online, and so on.

    • SkuID   The unique ID for the Office 365 plan.

    • SkuPartNumber   The name of the plan, for example “ENTERPRISEPACK.”

    • SubscriptionIds   A list of all subscriptions associated with this SKU. For the purposes of assigning licenses, all subscriptions with the same SKU are grouped into a single license pool.

    • SuspendedUnits   The number of suspended licenses. A license will go into a suspended state when it has expired and services are no longer available. These licenses are not available for assignment.

    • TargetClass   The target class of this account. Only accounts with “target class = user” are assignable.

    • WarningUnits   The number of warning units. A subscription to an account starts as enabled, but if the trial expires or a credit card is canceled, then the subscription goes into a warning state. The services still work when they are in a warning state.

  3. Type Get-MsolAccountSku at the command prompt to find out your AccountSkuId. When you do, you might see output like this:

    AccountSkuId                                  ActiveUnits     WarningUnits    ConsumedUnits  
    contoso:ENTERPRISEPACK                             25              0               21            

    This output means you have the Enterprise plan, and the AccountSKuId is the entire string contoso:ENTERPRISEPACK. Also, you have used 21 of the available 25 licenses.

  4. To list all the service plans that your ENTERPRISEPACK license includes, type this:

    Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq "ENTERPRISEPACK"} | `
     ForEach-Object {$_.ServiceStatus}

    The output looks like:

           ServicePlan                                     ProvisioningStatus                                 
           RMS_S_ENTERPRISE                                     Success                                            
           OFFICESUBSCRIPTION                                   Success                                            
           MCOSTANDARD                                          Success                                            
           SHAREPOINTWAC                                        Success                                            
           SHAREPOINTENTERPRISE                                 Success                                            
           EXCHANGE_S_ENTERPRISE                                Success

    In this list:


    Service plan Description


    Azure Active Directory Rights


    Office 365 ProPlus


    Lync Online


    Office Online


    SharePoint Online


    Exchange Online

Disable Office 365 service plans for a licensed user
  1. To disable one or more service plans, for example Office Online and Lync Online, first create an object reference ($O365Licenses) that holds the disabled plans option:

    $O365Licences = New-MsolLicenseOptions -AccountSkuId contoso:ENTERPRISEPACK `
  2. To disable service plans for an existing user, use the Set-MsoUserLicense cmdlet. In this example, you’ll disable Office Online and Lync Online for a user whose UPN is elaine@contoso.onmicrosoft.com.

    Set-MsolUserLicense -UserPrincipalName elaine@contoso.onmicrosoft.com `
      -LicenseOptions $O365Licences

    You can also use the same $O365Licences variable to disable Lync Online and Office Online when you assign a license to a new user:

    New-MsolUser -UserPrincipalName allieb@contoso.onmicrosoft.com `
    -DisplayName 'allieb' -FirstName Allie `
    -LastName Bellew -LicenseAssignment contoso:ENTERPRISEPACK `
    -LicenseOptions $O365Licences -UsageLocation US
Disable Office 365 service plans for all licensed users
  1. If you want to disable Lync Online and Office Online for all your users, create an object reference to hold the Office Online and Lync Online services that you are going to disable:

    $O365Licences = New-MsolLicenseOptions -AccountSkuId contoso:ENTERPRISEPACK `

    Type the following to disable the plans for all users:

    Get-MsolUser -All | `
    Set-MsolUserLicense -LicenseOptions $O365Licences
Re-add disabled Office 365 service plans to licensed users
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft