mirror of
https://github.com/admindroid-community/powershell-scripts.git
synced 2025-12-17 16:35:19 +00:00
Disable self-service capability in Microsoft 365
Disable self-service capability in Microsoft 365
This commit is contained in:
parent
267fe120cf
commit
445c6776eb
@ -0,0 +1,15 @@
|
||||
<#
|
||||
=============================================================================================
|
||||
Name: Disable self-service purchase for Microsoft 365 products
|
||||
Description: This script disables self-service purchase/ trial capability for all the supported M365 products
|
||||
Script written by: AdminDroid community team
|
||||
Website: admindroid.com
|
||||
=====================================================================================
|
||||
#>
|
||||
|
||||
Install-Module -Name MSCommerce -Scope CurrentUser #once you install you should remove this line
|
||||
Import-Module -Name MSCommerce
|
||||
Connect-MSCommerce #sign-in with your global or billing administrator account when prompted
|
||||
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | Where { $_.PolicyValue -eq “Enabled”} | forEach {
|
||||
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId $_.ProductID -Enabled $false
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user