+ Post New Thread
Results 1 to 8 of 8
Cloud Services Thread, Student Advantage - Powershell in Technical; Hello Would someone mind telling me what I am doing wrong here? I am connecting to the right bits Online ...
  1. #1
    tech-man's Avatar
    Join Date
    Jul 2005
    Location
    The Pub
    Posts
    172
    Thank Post
    13
    Thanked 17 Times in 11 Posts
    Rep Power
    21

    Student Advantage - Powershell

    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

  2. #2
    clareq's Avatar
    Join Date
    Dec 2005
    Location
    Doncaster
    Posts
    761
    Thank Post
    56
    Thanked 192 Times in 127 Posts
    Rep Power
    102
    I used the command: Get-MsolUser -UnlicencedUsersOnly -All| Set-MsolUserLicense -AddLicenses <organisation>: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.
    Last edited by clareq; 18th December 2013 at 10:33 AM.

  3. #3
    tech-man's Avatar
    Join Date
    Jul 2005
    Location
    The Pub
    Posts
    172
    Thank Post
    13
    Thanked 17 Times in 11 Posts
    Rep Power
    21
    That wont work for us as we have already granted Outlook & Office 365 so therefore they are not unlicenced....

  4. #4
    clareq's Avatar
    Join Date
    Dec 2005
    Location
    Doncaster
    Posts
    761
    Thank Post
    56
    Thanked 192 Times in 127 Posts
    Rep Power
    102
    Then take out the -unlicencedusersonly part. Getmsoluser -all is an accepted command.

  5. #5
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    667
    Thank Post
    4
    Thanked 147 Times in 136 Posts
    Rep Power
    54
    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)

  6. #6
    tech-man's Avatar
    Join Date
    Jul 2005
    Location
    The Pub
    Posts
    172
    Thank Post
    13
    Thanked 17 Times in 11 Posts
    Rep Power
    21
    No joy, throws a licence error...

    This command works:
    set-MsolUserLicense -UserPrincipalName xx@zz.com -AddLicenses XXXX:OFFICESUBSCRIPTION_STUDENT

    I want to be able to do this for all my users - odd

  7. #7
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    667
    Thank Post
    4
    Thanked 147 Times in 136 Posts
    Rep Power
    54
    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"
    }

  8. #8
    tech-man's Avatar
    Join Date
    Jul 2005
    Location
    The Pub
    Posts
    172
    Thank Post
    13
    Thanked 17 Times in 11 Posts
    Rep Power
    21
    Thanks guys... given up on this - I created a file in Excel to do them all on a one by one basis.



SHARE:
+ Post New Thread

Similar Threads

  1. Student Advantage favour needed!
    By jamesbmarshall in forum Cloud Services
    Replies: 3
    Last Post: 16th December 2013, 12:51 PM
  2. [Windows Software] Office 365 Student Advantage
    By timbo343 in forum Licensing Questions
    Replies: 1
    Last Post: 3rd December 2013, 04:05 PM
  3. Powershell - CMIS Student list in pipe
    By pcstru in forum Coding
    Replies: 1
    Last Post: 23rd July 2013, 09:42 AM
  4. Replies: 1
    Last Post: 29th November 2012, 03:54 PM
  5. Replies: 2
    Last Post: 2nd March 2011, 01:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •