License & Subscription Issues

How to Remove Yammer Service Plan via PowerShell (CSV Import)

Phi Hung VoPhi Hung Vo Oct 28, 2026 868 views

Question details

Administrator needs to disable the Yammer service plan for specific Microsoft 365 users using a CSV file.

How to Remove the Yammer Service Plan with an Import-CSV PowerShell Script
Product
Microsoft 365
Device & OS
not provided
Scenario
Disabling the Yammer service plan for multiple targeted users by importing their User Principal Names from a CSV file.
Observed behavior
Microsoft 365 accounts currently have Yammer enabled, and the administrator requires a bulk, scripted method to remove this specific license service plan without affecting other services.
Before you start

Ensure you have global or user administrator privileges in your Microsoft 365 tenant and have installed the required MSOnline PowerShell module.

Solution 1Recommended

Disable Yammer Service Plan using MSOnline PowerShell

Use a CSV file containing user principal names to systematically remove the Yammer Enterprise plan from selected users.

This method utilizes the MSOnline module to modify license options for a batch of users defined in a CSV file. It ensures only the Yammer plan is disabled while keeping other enterprise services intact.

While Microsoft Graph PowerShell is the modern alternative to the legacy MSOnline module, the MSOnline script remains widely documented and effective for bulk license management.

1
Create the CSV file

Create a CSV file (for example, D:\users.csv) containing a single column with the exact header 'userprincipalname'. Add the email addresses of the users you wish to modify below the header.

2
Connect to Microsoft Online

Open PowerShell as an administrator and run the command `Connect-MsolService`. Enter your Microsoft 365 administrator credentials when prompted.

3
Identify your Account SKU

Run the command `Get-MsolAccountSku` to find the correct AccountSkuId (e.g., yourorganization:enterprisepack) that contains the Yammer service plan.

4
Create the disabled plan options

Define the license modification by running: `$noyammer = New-MsolLicenseOptions -AccountSkuId organization:enterprisepack -DisabledPlans Yammer_Enterprise`. Be sure to replace the organization and SKU placeholders with your actual values.

5
Import CSV and apply changes

Execute the following commands to process the batch: `$users = Import-Csv D:\users.csv` followed by `$users | ForEach-Object { Set-MsolUserLicense -UserPrincipalName $_.userprincipalname -LicenseOptions $noyammer }`.

Disable Yammer Service Plan using MSOnline PowerShell
Testing Recommendation: Always test the PowerShell command on a single account before processing the entire CSV file to ensure no unintended service disruptions occur.
Free Microsoft Office alternative

Looking for a cost-effective office suite for your domain users?

While managing Microsoft 365 service plans and subscriptions, you might be looking for ways to reduce licensing costs. WPS Office provides a highly compatible, free alternative to Microsoft Office that satisfies everyday document, spreadsheet, and presentation needs without complex tenant management.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
  2. 2. Install and launch: Follow the straightforward installation wizard. WPS Office is lightweight and installs in seconds.
  3. 3. Open existing documents: Simply double-click your existing Microsoft Office files. WPS Office will open them seamlessly with perfect formatting.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight installation and low system requirements for enterprise deployments.Familiar, tabbed user interface that requires zero learning curve for users.Free core features, reducing the need for expensive enterprise subscriptions.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use Microsoft Graph PowerShell instead of MSOnline?

Yes, Microsoft Graph PowerShell is the recommended modern alternative. You can use the `Set-MgUserLicense` cmdlet along with the Microsoft Graph API to achieve similar results, as the MSOnline module is considered legacy.

How do I find the correct AccountSkuId for my tenant?

You can run the `Get-MsolAccountSku` command in PowerShell. This will return a list of all active license packages in your tenant, formatted as 'tenant_name:SKU_name'.

What happens if a user in the CSV file doesn't exist?

The script will throw an error for that specific user principal name in the console and automatically move on to the next user in the CSV file. The rest of the batch will process normally.

Will disabling Yammer remove the user's existing data?

Disabling the Yammer service plan prevents the user from accessing Yammer but does not immediately delete their data. Data retention policies configured in your Microsoft 365 admin center dictate when the data is ultimately purged.