CHiLL Posted October 23, 2015 Posted October 23, 2015 Hello, I am not great when it comes to Powershell, but I'm wondering if it is possible to bulk-assign licenses to groups of users? Or can it be done by pulling info from AD, such as attributes? Basically, we want these user groups to get these licenses: All Students Office 365 ProPlus for Students Office 365 Education for Students All Staff Office 365 Education for Faculty Full Time Teaching Staff Office 365 ProPlus for Faculty Note: I'd like it to also REPLACE all EXISTING licenses that the user currently has if at all possible. Note2: I have some attributes set in AD attribute Editor extensionAttribute1 = Set to either 'Staff' or 'Students' extensionAttribute2 = Set as 'Fulltime' or left null/empty Can a Powershell script use these AD attributes and replace the existing licenses and replace them with pre-defined ones? So for example: PS connects to O365 Get all O365 users with 'Students' in the extensionAttribute1 attribute Replace existing O365 licenses with ProPlus for Students and Education for Students. Script ends Does anybody know how to achieve this? If I can keep using the extensionAttribute1 field, that would be great and save me some time!
halbaradkenafin Posted October 23, 2015 Posted October 23, 2015 (edited) Ideally this would be two scripts, one for the license side and one for the AD extensionattribute side. I've got one for the first part and the second should be possible with Set-ADUser. I'll dig out my script and post it up for you. Edit: Just re-read your post and you've already got the attributes set. So here is the script that I use to add licenses to users, usually as part of the new year process. You can call it from the command line with something like this: .\Add-License.ps1 -Users (Get-ADUser -filter {ExtensionAttribute1 -like "Students"}) That should assign the students the correct licenses, you can double check the full names of your licenses by connecting to O365 from a prompt and running Get-MsolAccountSKU. You can achieve the same thing for staff by modifying the licenses it applies and changing the filter in Get-ADUser to the relevant attributes. Edited October 23, 2015 by halbaradkenafin
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now