none
Disable O365 License Service in Powershell and retain other apps RRS feed

  • Question

  • I'm new to Office 365 administration, so forgive me if this is an obvious answer. 

    I need to disable Powerapps and Flow for all users on our Enterprise license subscription, regardless of what other apps they have enabled on their account. I did some research and found a powershell script to do this, and I was able to successfully remove these services from a couple test users using the following: 

    --

    $Variable = new-MsolLicenseOptions -AccountSkuId <EnterpriseLicense> -disabledplans FLOW_O365_P2,POWERAPPS_O365_P2

    set-msoluserlicense -userprincipalname <TestUser> -licenseoptions $Variable

    --

    The problem is that this method will set all other services within that subscription to enabled. This is an issue because many of our users have different application access on an ad-hoc basis, i.e. they requested access to a certain app and somebody logged into the portal and gave it to them. So, there is no consistent license option that I can deploy to all users that will not either add unneeded app access or remove needed app access from several users. I simply need to keep whatever is existing for each user, but remove Flow and Powerapps. 

    So, my question is: Is there a way to simply remove access to these apps from all users through Powershell, without affecting the rest of the apps they can access? 

    Thanks for any insight. 


    Tuesday, September 5, 2017 10:49 PM

All replies

  • https://technet.microsoft.com/en-us/library/dn771769.aspx

    顺其自然地勇往直前!—Justin Liu

    Wednesday, September 6, 2017 8:14 AM
  • Hi Justin, thanks for the response. However, this is the same resource I used for the command I noted in my original post. The problem with this command, is that when running it against existing Office 365 accounts, it will automatically enable any applications that were previously disabled, unless I specify in the command that I want them to be disabled applications. 

    Example:

    I have 3 users for whom I'd like to disable PowerApps and Flow. In additional to PowerApps and Flow, User 1 currently has SharePoint and Exchange, User 2 currently has Exchange and Teams, User 3 currently has Planner and SharePoint. I would like to retain the existing application access for each respective user, except for removing PowerApps and Flow. 

    I run a powershell script to disable PowerApps and Flow against all 3 user accounts. I check the service status of these accounts after running the script, and PowerApps and Flow are disabled for all of them. However, the rest of the apps that are part of our Enterprise Pack are now enabled for all 3 users. This is not what I want to happen - I want each user to retain their previous application access, but also to have PowerApps and Flow removed. 

    Hopefully this makes sense. Thanks again for any help. 

    Wednesday, September 6, 2017 3:17 PM
  • Hi

    what about this?

    https://gallery.technet.microsoft.com/office365/PowerShell-Script-to-7d0920ad


    I am using a old computer with Windows 2003 so I can not verify that.and did you see the long version of the msdn article?

    The long version (instructions with detailed explanations)

    By default, all services are enabled when you issue a license by using Office 365 PowerShell. And often that’s a good thing: that means that you can quickly and easily assign licenses to users without having to specify that each and every service be enabled along the way.

    Having said that, however, it’s also true that you might want to restrict the services available some of your users; for example, maybe some users should have access to Office Professional Plus, Skype for Business Online, and Exchange Online, but those same users shouldn’t have access to SharePoint Online or to Office Online. Can you restrict accounts in that fashion? As it turns out, you can. To help explain how this works, let’s take a two-step approach to tackling this problem:

    1. Assign the user an Office 365 license that automatically enables all the services.

    2. Run a pair of Office 365 PowerShell commands that disable specified services for that user.


    顺其自然地勇往直前!—Justin Liu

    Thursday, September 7, 2017 3:19 AM