Disable Self-Service Purchase option Office 365 Products

Microsoft has announced bringing the self-service purchase options for multiple products which many Office 365 organizations has shown concerns as they manage their subscriptions and do not want users to buy products on their own.

Here is the announcement:


To manage these capabilities, you need to use PowerShell MSCommerce module.

Install the module from the PowerShell Gallery:

Install-Module -Name MSCommerce


Now Connect to MSCommerce à
Connect-MSCommerce


Let us first check the current status of the products whether they are setup for Self-Service purchase or not.

Here is the command to do that:

Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase


In the above example every product has been set to enabled by default.

You can disable the self-service purchase option for single product using below command:

Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KP0N -Enabled $False

-Enabled $False means à Self service purchase option is Disabled.

-Enabled $True means à Self service purchase option is Enabled.


To Disable All the products, we can use below script that does foreach loop and disable all.

Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | ForEach-Object{Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId $_.ProductId -Enabled $False}

To Enabled All, just change the -Enabled to $True.


You can manage these on product basis or just disable for all. (Many of our customers are preferring later as of now).

Reference: Use AllowSelfServicePurchase for the MSCommerce PowerShell module

 

Thanks for reading….

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Cheat Book

 

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s