Powershell Commands for removing Microsoft Invoicing in Office 365?

Hi All,

Microsoft just loves dropping in new apps into the Apps section of Office 365, but I was wondering if anyone knew of a way to remove specifically just Microsoft Invoicing from the apps?

Secondarily, maybe there is a way to do it across the organization in O365 but I haven’t found it yet, just removing the license individually which is a PITA.

I know how to connect to Office 365 + MFA through PowerShell, just wondering if someone knows the proper syntax for Microsoft Invoicing.

I was able to do some digging and found a Mcirosoft article on the topic:

https://docs.microsoft.com/en-us/office365/enterprise/powershell/disable-access-to-services-with-office-365-powershell

Here, you can create a License Option for either a new user, current user(s) or group of users. Basically, you build out a rule against the Service Detail (app) that you want to disable. But, you have to find the name of each app you want to disable, you cannot just choose one, if you choose one only, it enables all the rest of the licenses under that specific plan. Learned this the hard way.

Be sure to run this parameter:

$LO = New-MsolLicenseOptions -AccountSkuId <SKU> -DisabledPlans “MICROSOFTBOOKINGS”, “DYN365BC_MS_INVOICING”, “SWAY”, “STREAM_O365_SMB”, “KAIZALA_O365_P2”, “DESKLESS”, “POWERAPPS_O365_P1”

Then run this command:

Set-MsolUserlicense -userprincipalname user@contoso.com -licenseoptions $LO

 

Here is an example of what I used, then you apply this against a user or group of users.

Get-Content “C:\users\xxxx\My Documents\users.txt” | foreach {Set-MsolUserLicense -UserPrincipalName $_ -LicenseOptions $LO}

 

This was used against a targeted group of REAL users.

be very careful when performing this activity, unless all of your users are licensed exactly the same.

i’ve had to clean up more than once after an activity of this nature where that was assumed.

the end result of your script will have every one of your users listed, to have the exact same licenses enabled, (this can be a big issue with some regulatory requirements and legal retention)

Agreed. The lead admin on this said to license everyone the same way because what we disabled isn’t used at all across the organization. All other employees are given every other license.

Thanks for the feedback.