Jump to content

Recommended Posts

Posted

I have started the slow switch to office 365, DIRSYNC seemed to run well and has provisioned all my users,

but i have noticed by default they are not assigned a license, Do i have to manually for through every page ( 20 on a page) and select all users and assign a license?

 

Is there not some sort of powershell command that can select all and apply a license?

 

Thanks

 

Andy

Posted

You can select multiple users at once, if you haven't got many users to deal with this may be ok.

 

Alternatively use PowerShell, the way I do this is to do an export out of Office 365 of all unlicensed users over night to a csv and then assign licenses to the users in the csv.

Posted

We use powershell, found from this forum and other places, I've taken this script and tweaked it:

 

#Script to Assign Office365 Licenses to Students based on Department setting in AD
#Taken from various forums and websites
#
# Set Options
$AccountSkuId="XXXXXXXXX:STANDARDWOFFPACK_STUDENT"

# Set The Option Sku ID which is the Office Open Advantage License (Student Advantage)
$AccountSkuIDOption="XXXXXXXXX:OFFICESUBSCRIPTION_STUDENT"

# License Option is disabling Lync Online
$LicOptions=New-MsolLicenseOptions -AccountSkuID $AccountSkuId -DisabledPlans MCOSTANDARD

# Get User List that are unlicensed, sync'd with AD and in the specified Department
$users = Get-MsolUser -UnlicensedUsersOnly -Synchronized -Department "XXXXXXXXXX"

#For each user we found, we will loop thought them and apply settings
Write-Host "Set Licence"
foreach ($user in $users)
{

#Displays on screen the user we are updaing purely for debugging purpose
Write-Host $user.UserPrincipalName

#Set the Location to GB for the user which resolves the "error" that is detected
Set-MsolUser -UserPrincipalName $user.UserPrincipalName -UsageLocation GB

#Set the Office 365 license for the user based on the value selected above. This is purely for students
Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -AddLicenses $AccountSkuId -LicenseOptions $LicOptions

#Set the Office 365 Option License (Student Advantage)
Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -AddLicenses $AccountSkuIDOption

}

 

This assigns an A2 Student License and also a Student Open Advantage License BUT disables the Lync license - I've included a department filter in there also as I use this field to help separate the account types and applied this to a particular intake at a time.

 

Open up Powershell and use the following commands before hand to create a link between your PC and Office365 Tennant.

 

Set-ExecutionPolicy RemoteSigned

Import-Module MSOnline

$O365Cred = Get-Credential

$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri [url]https://ps.outlook.com/powershell[/url] -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session

Connect-MsolService –Credential $O365Cred

 

You'll need to fill in the bits where I've put XXXXX's with info specific to your account; you can use the command 'Get-MsolAccountSku' to show the SKU's that you have available to you. I used this to assign licenses to all our staff and over 1200 students. Worked well.

 

Pete

  • Thanks 1

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...