Turn Off Self-Service Purchases in Microsoft 365

Microsoft 365 has a route for users to buy their own products rather than products purchased and licenced by the company. This blog outlines how to turn this off.

Install the MSCommerce PowerShell module with Install-Module MSCommerce

Connect to the MSCommerce endpoint with Connect-MSCommerce and login with the administrator account

List all the products you are able to purchase “self-service” and see the state of these products, that is Enabled or Disabled. Do this with Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase – you can see them all disabled in the below picture, but the default is they would all be enabled.

Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase

The list of products as of the date of writing this blog in Sept 2021 totals 12 products. As new products are added you will need to come in here and disable them as they will be added in an enabled for self-service purchase state.

To turn all these products off, just run the following PowerShell:

Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0HHS9 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0HX99 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0J203 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KP0N -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KP0P -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KXG6 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KXG7 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KXN8 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KXN9 -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KXNC -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KXND -Enabled $False
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0L3PB -Enabled $False

If you connect to your MSCommerce endpoint in Microsoft 365 in the future and see new ProductIDs please add a comment to this blog and I will update the list above – this allows us all to just copy and paste the list into PowerShell and turn all self-service features off.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.