Jump to content

Recommended Posts

Posted

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

Posted
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.
  • Thanks 1
Posted (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 by EduTech
  • Thanks 1
Posted

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.

Posted

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.

  • Thanks 1
  • 3 weeks later...
Posted

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

  • Thanks 1
Posted
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 :yo:
Posted
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

  • 7 months later...
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...