+ Post New Thread
Page 1 of 4 1234 LastLast
Results 1 to 15 of 57
Cloud Services Thread, Office 365 questions in Technical; Morning, I have DIRSYNC setup which uploads all the users in defined OU's to the cloud but have a couple ...
  1. #1

    Join Date
    Nov 2005
    Location
    North
    Posts
    1,903
    Thank Post
    25
    Thanked 96 Times in 76 Posts
    Rep Power
    51

    Office 365 questions

    Morning,

    I have DIRSYNC setup which uploads all the users in defined OU's to the cloud but have a couple of questions.

    Is there a way to set the user location of the accounts in the domain so it uploads to the cloud without scripting. Actually is there a way to assign licenses without having to script?
    Where does it get the security groups from? I have 4 that its synced and they seem to be random.

    Just curious because I have spent hours trawling through the internet looking for clever scripts to automate this stuff and I hate scripting, its all dutch to me.

  2. #2
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    729
    Thank Post
    5
    Thanked 159 Times in 148 Posts
    Rep Power
    56
    Quote Originally Posted by Simcfc73 View Post
    Is there a way to set the user location of the accounts in the domain so it uploads to the cloud without scripting.
    If you mean their geographical location, it's a case of either script it or use the portal interface.

    Quote Originally Posted by Simcfc73 View Post
    Actually is there a way to assign licenses without having to script?
    Well you can assign them manually via the Portal, but otherwise you need to script it (examples can be found within this forum )

    Quote Originally Posted by Simcfc73 View Post
    Where does it get the security groups from? I have 4 that its synced and they seem to be random.
    With DirSync, it will pick up security groups from OU's that you have specified to synchronise

    Quote Originally Posted by Simcfc73 View Post
    Just curious because I have spent hours trawling through the internet looking for clever scripts to automate this stuff and I hate scripting, its all dutch to me.
    As again, a few of us already have the powershell scripts posted within Edugeek forums that will take your synchronised users and assign the licences/mailbox policies so all you really need to do is add it to a scheduled task on a server. I run ours hourly from 8am until 6pm.

  3. #3
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,291
    Thank Post
    219
    Thanked 238 Times in 206 Posts
    Rep Power
    76
    When you say you have it synching users from defined OU's, are these ones you defined yourself or have you just got it to sync your entire directory?

    And yes, you have to use a script if you want to automate the licence assignment Which sucks

  4. #4
    gshaw's Avatar
    Join Date
    Sep 2007
    Location
    Essex
    Posts
    2,726
    Thank Post
    176
    Thanked 229 Times in 211 Posts
    Rep Power
    69
    Force yourself to learn enough Powershell to get through the script-based tasks and it'll serve you well in the future, it's a very powerful tool

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,374
    Thank Post
    906
    Thanked 1,811 Times in 1,559 Posts
    Blog Entries
    12
    Rep Power
    468
    Run this in O365 powershell. It will set the location for all users for you

    Get-msoluser | set-msoluser -usagelocation "GB"

  6. #6

    Join Date
    Nov 2005
    Location
    North
    Posts
    1,903
    Thank Post
    25
    Thanked 96 Times in 76 Posts
    Rep Power
    51
    Quote Originally Posted by gshaw View Post
    Force yourself to learn enough Powershell to get through the script-based tasks and it'll serve you well in the future, it's a very powerful tool
    I think I am starting to realise that the admin portal website is a viewer and if you want to do anything useful you have to use scripts. I guess I am just lazy and like a GUI, back to 1985 I go

  7. #7

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,271
    Thank Post
    884
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    11
    Rep Power
    785
    Quote Originally Posted by Simcfc73 View Post
    I think I am starting to realise that the admin portal website is a viewer and if you want to do anything useful you have to use scripts. I guess I am just lazy and like a GUI, back to 1985 I go
    No, MS is lazy. When thy brought out PS they said they would still provide support for GUI tools then promptly did everything is PS and tacked on a few slow hack gui shells on top. I still prefer Exchange 2003 as once they went PS it became slow and cumbersome to actually use in comparison.

    MS has stopped developing the configuration layer, you are now expected to develop it yourself every single time which explains o365 sharepoint when it comes to education also. We must get used to the fact that now at least half of our jobs are remaking the wheel over and over and over again. If you have tickets to 1985 can I come with you??

  8. Thanks to SYNACK from:

    Simcfc73 (4th February 2014)

  9. #8

    Join Date
    Nov 2005
    Location
    North
    Posts
    1,903
    Thank Post
    25
    Thanked 96 Times in 76 Posts
    Rep Power
    51
    Quote Originally Posted by SYNACK View Post
    No, MS is lazy. When thy brought out PS they said they would still provide support for GUI tools then promptly did everything is PS and tacked on a few slow hack gui shells on top. I still prefer Exchange 2003 as once they went PS it became slow and cumbersome to actually use in comparison.

    MS has stopped developing the configuration layer, you are now expected to develop it yourself every single time which explains o365 sharepoint when it comes to education also. We must get used to the fact that now at least half of our jobs are remaking the wheel over and over and over again. If you have tickets to 1985 can I come with you??
    Thank god I am not alone in the fight.

    Spent an hour now looking for a decent script that suits my needs but given up for now. I don't want to have to mess around with attributes to define kids and teachers in my active directory and I just want to assign part of the A2 license as I don't want exchange or lync. I will come back to it later.

    But I sorted it myself anyway.

    I added the word student to the Departments bit of ADUC (around 30 seconds) for all my users.

    I created a view which looks for the student in Departments (30 seconds) and unlicensed.

    Selected 20 at a time, and edited them and assigned licenses. if it showed 50 it would only take me 2 minutes to do them all.

    I know its not automated but I have done all my users (only 400 or so) in 5 minutes and I don't feel like Neo from The Matrix

  10. #9
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,291
    Thank Post
    219
    Thanked 238 Times in 206 Posts
    Rep Power
    76
    To do something similar in Powershell, the following would assign just email access (no sharepoint/lync/web based office apps) to people where department = student


    First define a variable to hold the license customization we want:

    Code:
    $nostustuff =new-msollicenseoptions –accountskuid NameOfSchool:STANDARDWOFFPACK_STUDENT –disabledplans SHAREPOINTWAC_EDU,SHAREPOINTSTANDARD_EDU,MCOSTANDARD
    Then run a line which pulls in all unlicensed users, with a department set as 'student' and then assign them the above options:

    Code:
    get-msoluser -all | where-object {($_.islicensed -ne "True") -and ($_.department -eq "Student")}| set-msoluserlicense –licenseoptions $nostustuff

  11. #10
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    729
    Thank Post
    5
    Thanked 159 Times in 148 Posts
    Rep Power
    56
    I've posted this script before, and it will do most of what you want.
    In this case it's only enabling exchange, but you get the idea.
    It will search for users who's Office is Student (change as required) and then set licensing and location.

    #Set the license options for Office 365, which in this case is just Exchange access
    $LicOptions = New-MsolLicenseOptions -AccountSkuId tenancy:STANDARDWOFFPACK_STUDENT -DisabledPlans MCOSTANDARD, SHAREPOINTWAC_EDU, SHAREPOINTSTANDARD_EDU
    #Search for users that have no licences as they have just been syncronised and store into array where username begins STU
    $users = Get-MsolUser -UnlicensedUsersOnly -Synchronized -MaxResults Unlimited | Where-Object {$_.Office -eq "Student" }
    #If we have no users then we can exit out of the script
    if (!($users)) {exit;}

    #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 "tenancy:STANDARDWOFFPACK_STUDENT" -LicenseOptions $LicOptions
    }

  12. #11
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    729
    Thank Post
    5
    Thanked 159 Times in 148 Posts
    Rep Power
    56
    @themightymrp solution is shorter and just as functional.

  13. Thanks to Boredguy from:

    themightymrp (4th February 2014)

  14. #12
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,291
    Thank Post
    219
    Thanked 238 Times in 206 Posts
    Rep Power
    76
    Admittedly, mine doesn't set the location settings But I have another line I use for doing that, essentially the same as @FN-GM 's

  15. #13

    Join Date
    Sep 2009
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Why is powershell so crap. I have been sat here for hours so far, trying to run

    $nostustuff =new-msollicenseoptions –accountskuid NameOfSchool:STANDARDWOFFPACK_STUDENT –disabledplans SHAREPOINTWAC_EDU,SHAREPOINTSTANDARD_EDU,MCOSTANDA RD

    yes I changed the NameofSchool

    get-msoluser -all | where-object {($_.islicensed -ne "True") -and ($_.department -eq "Student")}| set-msoluserlicense –licenseoptions $nostustuff

    keep getting

    Set-MsolUserLicense : Unable to assign this license because the license options are invalid.
    At line:1 char:118
    + get-msoluser -all | where-object {($_.islicensed -ne "True") -and ($_.department -eq "Student")}| set-msoluserlicense <<<< -licenseoptions$nostustuff + CategoryInfo : OperationStopped: ( [Set-MsolUserLicense], MicrosoftOnlineException +FullyQualifiedErrorId :Microsoft.Online.Administration.Automation.Invali dUserLicenseOptionException,Microsoft.Online.Admin istration.Automation.SetUserLicense

    any one got any ideas?

    Paul

  16. #14
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,291
    Thank Post
    219
    Thanked 238 Times in 206 Posts
    Rep Power
    76
    A couple of things for you:

    1) Run the following command to make sure you are using the correct name in place of the School name:

    Code:
    Get-msolaccountsku
    2) The above scripts assume you have populated the Department variable of your Active Directory user accounts with the value of 'Student'. This is not done by default and without it the powershell system will error out. To sort this out, highlight all of your users in the AD and right-click, properties. Go to the Organisation tab and fill in the Department box.

    You will either have to wait for the next replication of DirSync or force an update for the changes to propagate. Then the powershell should work

  17. #15

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    5,375
    Thank Post
    958
    Thanked 1,630 Times in 1,103 Posts
    Blog Entries
    47
    Rep Power
    711
    That error crops up if you try and licence a user that already has licences assigned, though quite why it manifests in that way I don't know. It's usually a sign for me that I've not swapped the correct CSV in while I migrate, you might have to check your conditional logic - instead of assigning a licence tweak the script to output details of the users so you can check it's genuinely returning unlicensed users.



SHARE:
+ Post New Thread
Page 1 of 4 1234 LastLast

Similar Threads

  1. Office 365 questions / advice needed
    By tj2419 in forum Cloud Services
    Replies: 1
    Last Post: 1st November 2012, 05:40 PM
  2. Office 365 Question
    By FN-GM in forum Cloud Services
    Replies: 8
    Last Post: 4th June 2012, 05:43 PM
  3. General Office 365 Questions, Help please!
    By AndyCan in forum Cloud Services
    Replies: 0
    Last Post: 22nd May 2012, 06:14 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
  •