Created
March 11, 2020 09:31
-
-
Save nicolonsky/ed657418d9b65f83238661b71f568d54 to your computer and use it in GitHub Desktop.
Disable self-service purchases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable Office 365 Self-Servicing Purchases | |
# src: https://docs.microsoft.com/en-us/microsoft-365/commerce/subscriptions/allowselfservicepurchase-powershell?view=o365-worldwide | |
# Install abd connect MSCommerce services with PowerShell | |
Install-Module -Name MSCommerce -Scope CurrentUser | |
Connect-MSCommerce | |
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | |
# Disable Self-Servicing for all products | |
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | % {Update-MSCommerceProductPolicy -PolicyId $_.PolicyId -ProductId $_.ProductID -Enabled $false} | |
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment