How to block users installing trial apps in M365 using PowerShell?

Oleg Tserkovnyuk 671 Reputation points
2023-04-25T13:09:02.12+00:00

Hello, I am looking for a way to change the settings described below from the PowerShell. From the Microsoft 365 admin center, go to "Settings" from the left-hand menu > "Org settings", select "Services" > "User owned apps and services" Clear the check mark from " Let users access the "Office Store" and “Let users start trials on behalf of your organization”

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
{count} votes

Accepted answer
  1. Carl Littrell 80 Reputation points
    2024-08-05T15:01:21.5866667+00:00
    $body = @'
    {
      "@odata.type": "#microsoft.graph.adminAppsAndServices",
      "settings": {
        "@odata.type": "microsoft.graph.appsAndServicesSettings",
        "isOfficeStoreEnabled": false,
        "isAppAndServicesTrialEnabled": false
      }
    }
    '@
    
    Invoke-GraphRequest -Method PATCH -Uri "https://graph.microsoft.com/beta/admin/appsAndServices" -Body $body -ContentType 'application/json'
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.