When you are migrating users to O365 there may be a requirement to run post migration scripts, for setting the users location, and enabling licenses. You may be performing the migrations using a csv, and users may be in different locations, so you cannot just run the commands against the entire organisation. The csv contains a list of User UPNs.
### First we must find out our License SKU to apply
Connect-MsolService Get-MsolAccountSku
### Set a users location to GB
Connect-MsolService Import-CSV "C:\UKUsers.csv" | %{Get-MSolUser -SearchString $_.UserPrincipleName | Set-MsolUser -UsageLocation GB | ft UserPrincipalName,DisplayName,IsLicensed,UsageLocation}
### Set users license, also disable Plans that are not needed, in our case we are just using Exchange Online so we disable everything else
Connect-MsolService $LicenseOptions = New-MsolLicenseOptions -AccountSkuId companyname:ENTERPRISEPACK -DisabledPlans SHAREPOINTENTERPRISE,MCOSTANDARD,OFFICESUBSCRIPTION,YAMMER_ENTERPRISE,SHAREPOINTWAC,RMS_S_ENTERPRISE Import-CSV "C:\UKUsers.csv" | %{Set-MsolUserLicense $_.UserPrincipleName –AddLicenses companyname:ENTERPRISEPACK –LicenseOptions $LicenseOptions}
![Share on Facebook Facebook](http://computercrashers.co.uk/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/facebook.png)
![Share on Twitter twitter](http://computercrashers.co.uk/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/twitter.png)
![Share on Google+ google_plus](http://computercrashers.co.uk/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/google_plus.png)
![Share on Linkedin linkedin](http://computercrashers.co.uk/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/linkedin.png)
![feather](http://computercrashers.co.uk/wp-content/plugins/social-media-feather/synved-social/image/icon.png)