Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Reducing Office 365 Licenses With Powershell

$
0
0

Hello Spiceheads,

I've made an employee termination powershell script that automates a great deal of our workflow for departing employees. I want to add more features to it, so I'm working on having the script auto remove office 365 licenses. I have been able to use this powershell code to remove all licenses from users (thanks Neally)

Powershell
functionremoveLicenses{(get-MsolUser-UserPrincipalName$termUPN).licenses.AccountSkuId|foreach{Set-MsolUserLicense-UserPrincipalName$termUPN-RemoveLicenses$_}}

This code works great, however I still have licenses in my account. Does anybody know a powershell command to lower the number of licenses (as is displayed inGet-MsolAccountSku) I've also attached a picture of the admin console view online.


Basically, I want to have it remove the license so that purchased licenses is equal...


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>