Home > Office365 > Disable Office 365 Service Plans (Skype for Business, Exchange, SharePoint, Office) with PowerShell CMDLETS

Disable Office 365 Service Plans (Skype for Business, Exchange, SharePoint, Office) with PowerShell CMDLETS


As an Office 365 Engineer you may get different requests to amend licenses assigned for each individuals in the organization. In this article I will discuss and show you how to disable service plan objects with PowerShell commands. At the end of this article you will be able to create License Option to disable services such as Skype for Business, Exchange Online, SharePoint, and Office. 

As the first step,  let’s identify the AccountSkuId and SkuPartNumber value for each AccountSkuId. Trigger below PS command after you login to your Office 365 portal with the Admin account.

Get-MsolAccountSku | Format-Table AccountSkuId, SkuPartNumber

 

image

 

Here we go… we have got two Part Numbers named STANDARDPACK AND ENTERPRISESPACK. Actually these part numbers depend on plans or subscriptions you have purchased.

Now we need to create a License Option object forch AccountSkuid. To get a detailed understanding about  the office 365 Service Plan Sku’s you can refer my previous article.

 

Disable Skype for Business Plan

 

1. Create a LicenseOption object for each AccountSkuId

Syntax:

$LicenseOption_object_name = New-MsolLicenseOptions -AccountSkuId your-AccountSkuId -DisabledPlans MCOSTANDARD

$LicenseOption_object_name.GetType()

Let’s name the License Object name as “$CloudObj”

 

Example:

$myCloudObj = New-MsolLicenseOptions –AccountSkuId domain:STANDARDPACK -DisabledPlans MCOSTANDARD

$myCloudObj.GetType()

 

2. Disable Skype Business for all users

To disable Skype for Business for all users, run the following command for each LicenseOption object you created in the Step 1

 

Syntax:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $LicenseOption_object_name

Example:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $myCloudObj

3. Disable Skype for Business for specific user

Syntax:

Set-MsolUserLicense -UserPrincipalName user-UPN –LicenseOptions $LicenseOption_object_name

 

Example:

Set-MsolUserLicense – –UserPrincipalName dilshan@domain.com –LicenseOptions $myCloudObj

image

Disable Exchange Online Plan

1. Create a LicenseOption object for each AccountSkuId

Syntax:

$LicenseOption_object_name = New-MsolLicenseOptions -AccountSkuId your-AccountSkuId -DisabledPlans EXCHANGE_S_ENTERPRISE

$LicenseOption_object_name.GetType()

Let’s name the License Object name as “$CloudObj”

 

Example:

$myCloudObj = New-MsolLicenseOptions –AccountSkuId domain:STANDARDPACK -DisabledPlans EXCHANGE_S_ENTERPRISE

$myCloudObj.GetType()

 

2. Disable Exchange Online for all users

To disable Exchange Online for all users, run the following command for each LicenseOption object you created in the Step 1

 

Syntax:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $LicenseOption_object_name

Example:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $myCloudObj

 

3. Disable Exchange Online for specific user

Syntax:

Set-MsolUserLicense -UserPrincipalName user-UPN –LicenseOptions $LicenseOption_object_name

 

Example:

Set-MsolUserLicense – –UserPrincipalName dilshan@domain.com –LicenseOptions $myCloudObj

Disable SharePoint Online Plan

 

1. Create a LicenseOption object for each AccountSkuId

Syntax:

$LicenseOption_object_name = New-MsolLicenseOptions -AccountSkuId your-AccountSkuId -DisabledPlans SHAREPOINTENTERPRISE

$LicenseOption_object_name.GetType()

Let’s name the License Object name as “$CloudObj”

 

Example:

$myCloudObj = New-MsolLicenseOptions –AccountSkuId domain:STANDARDPACK -DisabledPlans SHAREPOINTENTERPRISE

$myCloudObj.GetType()

 

2. Disable SharePoint Online for all users

To disable SharePoint Online for all users, run the following command for each LicenseOption object you created in the Step 1

 

Syntax:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $LicenseOption_object_name

 

Example:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $myCloudObj

 

3. Disable SharePoint Online for specific user

Syntax:

Set-MsolUserLicense -UserPrincipalName user-UPN –LicenseOptions $LicenseOption_object_name

 

Example:

Set-MsolUserLicense –UserPrincipalName dilshan@domain.com –LicenseOptions $myCloudObj

 

Disable Office Professional Plus Plan

 

1. Create a LicenseOption object for each AccountSkuId

Syntax:

$LicenseOption_object_name = New-MsolLicenseOptions -AccountSkuId your-AccountSkuId -DisabledPlans SHAREPOINTENTERPRISE

$LicenseOption_object_name.GetType()

Let’s name the License Object name as “$CloudObj”

 

Example:

$myCloudObj = New-MsolLicenseOptions –AccountSkuId domain:STANDARDPACK -DisabledPlans SHAREPOINTENTERPRISE

$myCloudObj.GetType()

 

2. Disable Office for all users

To disable Office for all users, run the following command for each LicenseOption object you created in the Step 1

Syntax:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $LicenseOption_object_name

 

Example:

Get-MsolUser | Set-MsolUserLicense –LicenseOptions $myCloudObj

3. Disable Office for specific user

Syntax:

Set-MsolUserLicense -UserPrincipalName user-UPN –LicenseOptions $LicenseOption_object_name

 

Example:

Set-MsolUserLicense – –UserPrincipalName dilshan@domain.com –LicenseOptions $myCloudObj

 

I hope this will help for you guys….

Advertisements
Categories: Office365
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: