+ Post New Thread
Results 1 to 10 of 10
Cloud Services Thread, Auto-Provisioning Office 365 Licences in Technical; Hi guys, I'm trying to auto-provision/license staff with one plan and students with another in Office 365. I was looking ...
  1. #1

    Join Date
    Aug 2012
    Location
    Solihull
    Posts
    115
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5

    Auto-Provisioning Office 365 Licences

    Hi guys,

    I'm trying to auto-provision/license staff with one plan and students with another in Office 365.

    I was looking at this: How to Use PowerShell to Automatically Assign Licenses to Your Office 365 Users - TechNet Articles - United States (English) - TechNet Wiki but not being great with LDAP or Powershell, anyone have an idea:

    SKU.jpg

    I want it to use my 'students' group as the group it looks to to provision students with one of the SKU's (Not that I can see the actual full SKU yet) - any ideas on the ldapDisplayName I need to enter here?

    Thanks

    Stephen

  2. #2
    Jasbo's Avatar
    Join Date
    Mar 2014
    Location
    West Sussex
    Posts
    152
    Thank Post
    12
    Thanked 20 Times in 20 Posts
    Rep Power
    5
    Hi, I did see that article a while back and decided it was a PITA,

    there's some topics on here about this that enabled me to get a working script to assign different licensing combinations to staff and students, will send you mine via pm on Monday if you what to take a look?

  3. #3

    Join Date
    Aug 2012
    Location
    Solihull
    Posts
    115
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5
    Cheers

    PITA?

  4. #4

    Join Date
    Aug 2012
    Location
    Solihull
    Posts
    115
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5
    PITA - got it yes indeed, it really shouldn't be that damn hard.

    I have 4 user groupings. Teaching, non-teaching, domain admins and students, I want the staff types to have one set of licences and a mailbox created and students a different licence and mailbox.

    Pretty simple, and if I used an on site exchange it would be easy...

  5. #5

    Join Date
    May 2011
    Posts
    80
    Thank Post
    8
    Thanked 11 Times in 11 Posts
    Rep Power
    8
    Stephen

    Not exactly sure I have what you need but I have two Powershell scripts that assign our staff with one script and students with a second.

    This is because we have our staff on our main domain with our students on a sub @student domain

    I'll log on shortly and get the code

  6. #6

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,074
    Thank Post
    160
    Thanked 937 Times in 731 Posts
    Blog Entries
    3
    Rep Power
    275
    I will smile for now, but in terms of today let me try and get you something that will handle this via PowerShell. In terms of how you define the groups of users, do you do this via Security Group or do you have a specific attribute populated?

    Thanks,
    James.

  7. #7

    Join Date
    May 2011
    Posts
    80
    Thank Post
    8
    Thanked 11 Times in 11 Posts
    Rep Power
    8
    We do it via Active Directory OU membership (our staff and students are in separate OU's), this is for our Students;

    Import-module ActiveDirectory
    $AccountSkuId = "OUR-TENNANT-NAME[/B]:STANDARDWOFFPACK_STUDENT"
    $UsageLocation = "GB"
    $LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId
    $Users = Get-ADUser -Filter * -SearchBase "OU=Students,DC=%domain%,dc=%domain%,dc=ac,dc=uk"
    $Users | ForEach-Object {
    Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
    Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId -LicenseOptions $LicenseOptions
    }
    We have this saved as 'Students.ps1' and at the start of term run it as a scheduled task 3 times a day, but after the term has settled down we run it once a night/ or sometimes manually as after our main September intake we don't have a lot of students joining, etc.
    Last edited by jszkudlapski; 21st June 2014 at 10:14 PM.

  8. #8

    Join Date
    Aug 2012
    Location
    Solihull
    Posts
    115
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5
    We use group memberships to security groups James. I'd also like to know how on earth to read the SKUs when they appear to be over a certain character length 😜

  9. #9

    Join Date
    Aug 2012
    Location
    Solihull
    Posts
    115
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5
    Our student are in nested OUs under a main students one and staff are in other OUs so jszkudlapski's script may work..anyway to store the admin username and password though so it runs silently?

  10. #10

    Join Date
    Aug 2012
    Location
    Solihull
    Posts
    115
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5

    Kind of Working :D

    This script kind of works:

    Import-Module MSOnline
    $powerUser = "admin@XXXXX.onmicrosoft.com"
    $powerPass = "XXXXXX"
    $password = ConvertTo-SecureString $powerPass -AsPlainText -Force
    $adminCredential = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $powerUser,$password
    Connect-MSOLService -Credential $adminCredential

    Import-module ActiveDirectory
    $AccountSkuId = "XXXXXX:STANDARDWOFFPACK_STUDENT"
    $UsageLocation = "GB"
    $LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId
    $Users = Get-ADUser -Filter * -SearchBase "OU=Students,OU=XXX,OU=Establishments,DC=XXX,DC=XX X"
    $Users | ForEach-Object {
    Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
    Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId -LicenseOptions $LicenseOptions
    }


    it throws errors RE: Being unable to assign licenses to existing licensed users



    Set-MsolUserLicense : Unable to assign this license because it is invalid. Use the Get-MsolAccountSku cmdlet to retrieve a list of valid licenses.
    At C:\XXXX Office 365 Scripts\Office 365\Students_Provision.ps1:15 char:2
    + Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $Accou ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: ( [Set-MsolUserLicense], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.Invalid UserLicenseException,Microsoft.Online.Administrati on.Automation.SetUserLicense



    However, I now need to do the following:

    A) Copy every email either sent or received to every user into a separate email account for protection purposes
    B) Hide teaching staff from Students GAL

    Anyone have any ideas?

    Thanks

    Stephen

SHARE:
+ Post New Thread

Similar Threads

  1. Office 365 - Auto Populate The Lync Sing In Address
    By FN-GM in forum Cloud Services
    Replies: 7
    Last Post: 6th March 2014, 01:07 PM
  2. Replies: 2
    Last Post: 7th February 2014, 12:35 PM
  3. Office 365 auto-assign licenses
    By themightymrp in forum Cloud Services
    Replies: 9
    Last Post: 7th February 2014, 07:56 AM
  4. Office 365- Outlook Auto Account Setup
    By Tallwood_6 in forum Cloud Services
    Replies: 4
    Last Post: 2nd August 2013, 08:17 AM
  5. Replies: 0
    Last Post: 19th June 2013, 03:21 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
  •