tech-man Posted December 18, 2013 Posted December 18, 2013 Hello Would someone mind telling me what I am doing wrong here? I am connecting to the right bits Online etc Import-Csv c:\users\manager\desktop\test.csv | ForEach-Object {get-msoluser -SearchString $_.UserPrincipalName |Set-MsolUserLicense -AddLicenses XXXX:OFFICESUBSCRIPTION_STUDENT} I hate PowerShell! Thanks
clareq Posted December 18, 2013 Posted December 18, 2013 (edited) I used the command: Get-MsolUser -UnlicencedUsersOnly -All| Set-MsolUserLicense -AddLicenses :OfficeSUBSCRIPTION_STUDENT. I did have to set the location to GB first - I don't have the command to hand I used. Try adding a licence through the web interface - when I did that I was prompted to set location. Edited December 18, 2013 by clareq
tech-man Posted December 18, 2013 Author Posted December 18, 2013 That wont work for us as we have already granted Outlook & Office 365 so therefore they are not unlicenced....
clareq Posted December 18, 2013 Posted December 18, 2013 Then take out the -unlicencedusersonly part. Getmsoluser -all is an accepted command.
Boredguy Posted December 18, 2013 Posted December 18, 2013 You could also chuck in a | Where-Object {$.fieldname -like "your_value_here"} to limit your msolUser call to just students if you have a unique field (assuming both your staff and students are in 365 that is)
tech-man Posted December 18, 2013 Author Posted December 18, 2013 No joy, throws a licence error... This command works: set-MsolUserLicense -UserPrincipalName [email protected] -AddLicenses XXXX:OFFICESUBSCRIPTION_STUDENT I want to be able to do this for all my users - odd
Boredguy Posted December 18, 2013 Posted December 18, 2013 This is the script we are going to use. In my case it returns 950 results as our student accounts all start with STU.. $users = Get-MsolUser -all | Where-Object {$_.UserPrincipalName -like "STU*-*" } foreach ($user in $users) { Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -AddLicenses "BLAH:OFFICESUBSCRIPTION_STUDENT" }
tech-man Posted December 18, 2013 Author Posted December 18, 2013 Thanks guys... given up on this - I created a file in Excel to do them all on a one by one basis.
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