Just a heads-up: I posted two new PowerShell scripts for managing Office 365 user licenses. This one sets user licenses using a template-based approach:
https://community.spiceworks.com/scripts/show/3697-manage-office-365-user-license-lifecycle
And this one can be used to report on current user license assignments:
Hope you find these useful!