Disable Self Service Purchase in Microsoft 365

Disable Self Service Purchase in Microsoft 365
This commit is contained in:
AdminDroid 2023-09-13 12:02:25 +05:30
parent 445c6776eb
commit 02be18815a

View File

@ -7,7 +7,7 @@ Website: admindroid.com
===================================================================================== =====================================================================================
#> #>
Install-Module -Name MSCommerce -Scope CurrentUser #once you install you should remove this line Install-Module -Name MSCommerce -RequiredVersion 1.8 -Scope CurrentUser #once you install you should remove this line
Import-Module -Name MSCommerce Import-Module -Name MSCommerce
Connect-MSCommerce #sign-in with your global or billing administrator account when prompted Connect-MSCommerce #sign-in with your global or billing administrator account when prompted
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | Where { $_.PolicyValue -eq Enabled} | forEach { Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | Where { $_.PolicyValue -eq Enabled} | forEach {