How to Remove Yammer Service Plan via PowerShell (CSV Import)
Question details
Administrator needs to disable the Yammer service plan for specific Microsoft 365 users using a CSV file.

- 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.
Ensure you have global or user administrator privileges in your Microsoft 365 tenant and have installed the required MSOnline PowerShell module.
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.
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.
Open PowerShell as an administrator and run the command `Connect-MsolService`. Enter your Microsoft 365 administrator credentials when prompted.
Run the command `Get-MsolAccountSku` to find the correct AccountSkuId (e.g., yourorganization:enterprisepack) that contains the Yammer service plan.
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.
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 }`.

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. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
- 2. Install and launch: Follow the straightforward installation wizard. WPS Office is lightweight and installs in seconds.
- 3. Open existing documents: Simply double-click your existing Microsoft Office files. WPS Office will open them seamlessly with perfect formatting.

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.




