themightymrp Posted May 23, 2013 Posted May 23, 2013 Apologies if this is somewhere else, I can't seem to find it (by all means post me a link if its easier!) I have Office 365 all working the way I want it: SSO, Address Book Policies etc etc. However, when a new user is added to our Active Directory, they sync to O365 but are not assigned licenses. What is the easiest way to automate this? I can filter between staff and students via Powershell by querying the 'Office' attribute which I have set to 'Student' for the kids (if that helps?) Is there anyway to do this that doesn't involve Powershell? Cheers
jamesbmarshall Posted May 23, 2013 Posted May 23, 2013 There are Microsoft partners who have built solutions for automating this, but there's nothing that's part of the service. You could write a PowerShell script that will largely automate it, but not fully. 1
EduTech Posted May 23, 2013 Posted May 23, 2013 (edited) The way that I have done this in the past looking at my notes us using the following script that I have created: Connect-MSOLService $AccountSkuId="Insert SKU Here" $UsageLocation="GB" $LicenseOptions=New-MsolLicenseOptions -AccountSkuId$AccountSkuId $Users=Import-Csvc:\Users.csv $Users|ForEach-Object{ Set-MsolUser -UserPrincipalName$_.UserPrincipalName -UsageLocation$UsageLocation Set-MsolUserLicense -UserPrincipalName$_.UserPrincipalName -AddLicenses$AccountSkuId-LicenseOptions$LicenseOptions } The script basically configures the location of the user, and also assigns the relevant SKU (license) to the user object. I hope that helps. Regards, James. Edited May 23, 2013 by EduTech 1
themightymrp Posted May 23, 2013 Author Posted May 23, 2013 Cheers, I shall take a look at this and see what I can come up with. As a slight aside, how do you make a .PS1 powershell script run as an administrator? Its not in the context menu when you right-click and I'm unable to make powershell commands work correctly unless I open the program as Admin.
EduTech Posted May 23, 2013 Posted May 23, 2013 Launch your Microsoft Online Services PowerShell Console as Administrator, browse to the Directory of the Ps1 Script and then run it. Or, Just launch PowerShell as Administrator and just past the script in to the console :-) James. 1
Speculator Posted June 13, 2013 Posted June 13, 2013 Hey all, Just wondering if you've seen this script? I've got it working nicely, running every hour to license any users that aren't assigned, and to warn if the license count drops below a certain threshold. I'm about to write a post in my blog about getting it working (it's kinda poorly documented). Thanks. Apologies if this is somewhere else, I can't seem to find it (by all means post me a link if its easier!) I have Office 365 all working the way I want it: SSO, Address Book Policies etc etc. However, when a new user is added to our Active Directory, they sync to O365 but are not assigned licenses. What is the easiest way to automate this? I can filter between staff and students via Powershell by querying the 'Office' attribute which I have set to 'Student' for the kids (if that helps?) Is there anyway to do this that doesn't involve Powershell? Cheers 1
themightymrp Posted June 13, 2013 Author Posted June 13, 2013 Looks very promising for what I want to achieve! Thanks for the link, I will modify it slightly to be able to differentiate between my student accounts and staff accounts and assign the license accordingly - but thanks again
jamesbmarshall Posted June 13, 2013 Posted June 13, 2013 I've got it working nicely, running every hour to license any users that aren't assigned, and to warn if the license count drops below a certain threshold Automating the assignment of licences is a good thing - but I'd schedule the script to run in line with your provisioning methods (i.e. every 3hrs if you're using DirSync). I'd also be careful since I don't think this script accounts for users that are deliberately unlicensed. You could end up in a situation where you're assigning licences to users unintentionally. As @themightymrp says, this really needs to be extended to fit into the education scenario, but the basic framework is a good starting point. For what it's worth, the official method for automating licence assignment is here: How to use PowerShell to Automatically Assign Licenses to your Office365 Users - TechNet Articles - United States (English) - TechNet Wiki
jbailey Posted February 7, 2014 Posted February 7, 2014 Sorry to resurrect this, but... "# script to assign or swap the licenses of a user #Copyright Microsoft @ 2012 #DISCLAIMER #The sample scripts are not supported under any Microsoft standard support program or service. So are there any plans for MS to add better provisioning to their 365 product and provide a way for auto assignment of licenses via the Office 365 control panel in the future, or to have it integrated in Azure AD Sync maybe? thank you
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