Thursday, November 21, 2019

How to disable Office 365 self-service purchase

I am sure by now you have heard or read about Microsoft plans to allow Office 365 users to make self-service purchases for the Power Platform. This created such a storm of critics and complaints that Microsoft postponed the introduction of this feature to January 14, 2020. Additionally, it has finally released a way for admins to block such feature.

“Beginning January 14, 2020, self-service purchase, subscription, and license management capabilities for Power Platform products (Power BI, Power Apps, and Power Automate) will be available for commercial cloud customers in the United States. Self-service purchase gives users a chance to try out new technologies and lets them develop solutions that will ultimately benefit their larger organizations. This capability will not be available to tenants in the US that are government, nonprofit, or education, at this time. Central procurement and IT teams will have visibility to all users buying and deploying self-service purchase solutions through the Microsoft 365 admin center, and will be able to turn off self-service purchasing on a per product basis via PowerShell.”

On November 19, Microsoft updated their self-service FAQ and stated that “Admins can also control whether users in their organization can make self-service purchases. For more information see Use AllowSelfServicePurchase for the MSCommerce PowerShell module.”

The MSCommerce PowerShell module is now available on PowerShell Gallery. The module includes a PolicyID parameter value for AllowSelfServicePurchase that lets you control whether users in your organization can make self-service purchases.

You can use the MSCommerce PowerShell module to:
• View the default state of the AllowSelfServicePurchase parameter value — whether it's enabled or disabled;
• View a list of applicable products and whether self-service purchase is enabled or disabled;
• View or modify the current setting for a specific product to either enable or disable it.

To use the MSCommerce PowerShell module, you need:
• A Windows 10 device;
• Administrator permission for the device;
• Global or Billing Admin role for your tenant.

Install the MSCommerce PowerShell module
Download the MSCommerce PowerShell module from the PowerShell Gallery. To install the MSCommerce PowerShell module with PowerShellGet, run the following command:
Install-Module -Name MSCommerce

Import MSCommerce into the PowerShell session
After you install the module, import it into the PowerShell session by running the following command:
Import-Module -Name MSCommerce

Connect to MSCommerce
Finally, connect to the PowerShell module with your credentials. This command connects the current PowerShell session to an Azure Active Directory tenant. The command prompts you for a username and password for the tenant you want to connect to. If multi-factor authentication is enabled for your credentials, you use the interactive option to log in.
Connect-MSCommerce

View details for AllowSelfServicePurchase
To view a description of the AllowSelfServicePurchase parameter value and the default status, based on your organization, run the following command:
Get-MSCommercePolicy -PolicyId AllowSelfServicePurchase | FL



View a list of self-service purchase products and their status
To view a list of all available self-service purchase products and the status of each, run the following command:
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase





View or set the status for AllowSelfServicePurchase
After you view the list of products available for self-service purchase, you can view or modify the setting for a specific product. To get the policy setting for a specific product, run the following command:
Get-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KP0N



To enable the policy setting for a specific product, run the following command:
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KP0N -Enabled $True

To disable the policy setting for a specific product, basically preventing users from purchasing licenses themselves, run the following command:
Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId CFQ7TTC0KP0N -Enabled $False



To disable all three at the same time, you can use the following command:
Get-MSCommerceProductPolicies -PolicyId AllowSelfServicePurchase | ForEach {Update-MSCommerceProductPolicy -PolicyId $_.PolicyID -ProductId $_.ProductID -Enabled $False}

No comments:

Post a Comment