Forum Discussion

Balazs_Szajbert's avatar
Balazs_Szajbert
Copper Contributor
Nov 27, 2023

Disable Self Servie doesn't work

Hi all,

 

We would like to disable Self Service option for our users. I have used the following powershell code on the 19th of November 2023:

 

"Set-MsolCompanySettings -AllowAdHocSubscriptions $False"

 

After it i have checked with this one:

 

"Get-MsolCompanyInformation | Select AllowAdHocSubscriptions" because the

"Get-MsolCompanyInformation" command doesn't list this setting. So i tought i did it, well done, it was easy but on the 22th of November 2023 a user could sign up to Project Plan 1. This is not the worst thing because it will expire and no other purchase will be done but this is frustrating because i tought i turned off the option for our users. Can somebody help me what did i do wrong? I thought this command completely disables the option for all self service and self purchase applications.

 

Thank you very much,

Balazs

 

 

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi Balazs_Szajbert,

    It looks that you've taken the correct steps to disable self-service subscriptions. However, it's important to clarify that the `Set-MsolCompanySettings -AllowAdHocSubscriptions $False` command specifically addresses self-service sign-ups.

    To disable self-service purchasing, you should use the `Update-MSCommerceProductPolicy` command in the MSCommerce PowerShell module.
    The command would look like this:

    Update-MSCommerceProductPolicy -PolicyId AllowSelfServicePurchase -ProductId <product ID number> -Enabled $False

     

    Replace `<product ID number>` with the actual ID of the product you want to disable self-service purchasing for.

    You can use these links for more information:
    Manage self-service purchases and trials (for admins) | Microsoft Learn

    How To Block Self-Service Purchasing in Microsoft's Power Platform -- Redmondmag.com

    How to Block Self-Service Purchases of Windows 365 Licenses - Microsoft Community Hub


    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic
    (LinkedIn)

    • Balazs_Szajbert's avatar
      Balazs_Szajbert
      Copper Contributor

      LeonPavesic 

       

      Hi Leon,

       

      Is there any chance to block all self purchase products from users with one command?

       

      Thanks,

      Balazs

      • LeonPavesic's avatar
        LeonPavesic
        Silver Contributor

        Hi Balazs_Szajbert,

        thanks for your update and your question.

        As far as I know it is not possible to block all self purchase products from users with one PowerShell command.
        You will need to do this for each Product (ID) separately.

        Please click Mark as Best Response & Like if my post helped you to solve your issue.
        This will help others to find the correct solution easily. It also closes the item.


        If the post was useful in other ways, please consider giving it Like.


        Kindest regards,


        Leon Pavesic
        (LinkedIn)

Resources