+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
Cloud Services Thread, powershell command to remove Lync in Technical; Need a hand finding the powershell command to remove Lync from my current A2 Sku. Thanks!...
  1. #1
    the_dude's Avatar
    Join Date
    Nov 2012
    Location
    SoCal
    Posts
    78
    Thank Post
    0
    Thanked 15 Times in 10 Posts
    Rep Power
    5

    powershell command to remove Lync

    Need a hand finding the powershell command to remove Lync from my current A2 Sku.
    Thanks!

  2. #2

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    4,980
    Thank Post
    158
    Thanked 888 Times in 699 Posts
    Blog Entries
    3
    Rep Power
    265
    Quote Originally Posted by the_dude View Post
    Need a hand finding the powershell command to remove Lync from my current A2 Sku.
    Thanks!
    Do you just want to remove the licences for X amount of users?

    James.

  3. #3

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    6,875
    Thank Post
    393
    Thanked 581 Times in 532 Posts
    Rep Power
    173
    James - Even if that isn't what he wants, I'd like to know how to do it for the users assigned the Student licenses.

  4. #4
    jamesbmarshall's Avatar
    Join Date
    Feb 2010
    Location
    Reading, UK
    Posts
    454
    Thank Post
    24
    Thanked 204 Times in 142 Posts
    Rep Power
    80
    I have some PowerShell snippets that can help... I'm in a call right now but will writ e it up when I'm done

  5. #5

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    4,980
    Thank Post
    158
    Thanked 888 Times in 699 Posts
    Blog Entries
    3
    Rep Power
    265
    Hi,

    You can BULK modify the Licensing for Accounts using the following PowerShell Script:

    Connect-MSOLService
    $AccountSkuId="Insert SKU Here"
    $UsageLocation="GB"
    $LicenseOptions=New-MsolLicenseOptions -AccountSkuId$AccountSkuId
    $Users=Import-Csvc:\Users.csv
    $Users|ForEach-Object{
    Set-MsolUser -UserPrincipalName$_.UserPrincipalName -UsageLocation$UsageLocation
    Set-MsolUserLicense -UserPrincipalName$_.UserPrincipalName -AddLicenses$AccountSkuId-LicenseOptions$LicenseOptions
    }

    The part in which you want to edit if you should wish to disable certain aspects is as follows:

    $LicenseOptions = New-MsolLicenseOptions -AccountSkuId $AccountSkuId –DisabledPlans SHAREPOINTWAC,SHAREPOINTENTERPRISE

    In this example I am disabling SharePoint Online & Office Web Applications. If you want to disable Lync Online then you need to use the following: MCOSTANDARD

    To be honest, If you want to find out more information you should refer to the following article which is pretty handy (MS hadn't published this when I last did it so just found it out)

    Disable Lync Online, SharePoint Online, or both

    I hope that helps,

    James.

  6. #6
    the_dude's Avatar
    Join Date
    Nov 2012
    Location
    SoCal
    Posts
    78
    Thank Post
    0
    Thanked 15 Times in 10 Posts
    Rep Power
    5
    I've asked MS to remove the sku on the backed for my students. If that doesn't work I'll play with the script, although that could be tricky since we are fully automating account creation. Thanks for the responses.

  7. #7
    jamesbmarshall's Avatar
    Join Date
    Feb 2010
    Location
    Reading, UK
    Posts
    454
    Thank Post
    24
    Thanked 204 Times in 142 Posts
    Rep Power
    80
    Quote Originally Posted by the_dude View Post
    I've asked MS to remove the sku on the backed for my students. If that doesn't work I'll play with the script, although that could be tricky since we are fully automating account creation. Thanks for the responses.
    I don't think Microsoft Support will do that (not ordinarily anyway).

    How do you handle your licensing at the moment, given that you have fully automated account creation? The steps above, broadly speaking, are what you need to build a script to assign sub-components of the A2 plan if you don't want to assign the full plan.

    It would be fairly straightforward to build a script that reads an attribute from your users (lets say you populate customAttribute1 with "student" or "teacher") and then assigns the correct workloads from that.

  8. #8
    Boredguy's Avatar
    Join Date
    Jun 2011
    Location
    Swindon
    Posts
    464
    Thank Post
    2
    Thanked 107 Times in 98 Posts
    Rep Power
    24
    When we sync our users, we assign the students the following powershell to assign the licence

    $LicOptions = New-MsolLicenseOptions -AccountSkuId tenancynamehere:STANDARDWOFFPACK_STUDENT -DisabledPlans MCOSTANDARD, SHAREPOINTWAC_EDU, SHAREPOINTSTANDARD_EDU
    Set-MsolUserLicense -UserPrincipalName $user.UserPrincipalName -AddLicenses "tenancynamehere:STANDARDWOFFPACK_STUDENT" -LicenseOptions $LicOptions


    This just gives the students e-mail and not Lync. We have this in a search to ensure it's just the kids that it applys to and not staff
    Here is our full script
    #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 50 | Where-Object {$_.UserPrincipalName -like "STU????-*" }
    #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
    }

    #Pause the script for 1 minute to ensure that the account has been created by Exchange before we start processing the next bit. Not really needed for bulk uploads
    Start-Sleep -Seconds 60

    Write-Host ""
    Write-Host "Set Exchange"
    #Loop though each user again, but this time we are altering their e-mail settings
    foreach ($user in $users)
    {
    #Again for debug purpose we write out their name
    write-Host $user.UserPrincipalName
    #Set their Address book, role assignment and sharing policy to be the student related one
    Set-Mailbox -Identity $user.UserPrincipalName -AddressBookPolicy "ABP_Students" -RoleAssignmentPolicy "Pupil Role Assignment Policy" -SharingPolicy "Pupil Sharing Policy"
    #Set the OWA Mailbox Policy
    Set-CASMailbox -Identity $user.UserPrincipalName -OwaMailboxPolicy "Pupils"
    }

    exit
    Forgot to say, we run this script as a scheduled task every hour to ensure that any new students that DirSync has added gets the correct settings without us having to worry about it. So far it's been working great
    Last edited by Boredguy; 9th August 2013 at 11:47 AM.

  9. #9
    the_dude's Avatar
    Join Date
    Nov 2012
    Location
    SoCal
    Posts
    78
    Thank Post
    0
    Thanked 15 Times in 10 Posts
    Rep Power
    5
    We are using UMRA by tools forever, it pulls the users from our SIS, generates the AD accounts and creates their Office 365 email account. I wonder if I can just add the -DisabledPlans MCOSTANDARD to where I declare the variable for the SKU. Going to check with the vendor (tools4ever). It sounds like I could also run a scheduled task to strip the sku from the user.

  10. #10
    the_dude's Avatar
    Join Date
    Nov 2012
    Location
    SoCal
    Posts
    78
    Thank Post
    0
    Thanked 15 Times in 10 Posts
    Rep Power
    5
    just to recap UMRA tech support helped me add the above script to the automation. Thanks for the responses.

  11. #11

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    6,875
    Thank Post
    393
    Thanked 581 Times in 532 Posts
    Rep Power
    173
    What exactly is a License Object? Are these temporary, or not? In those scripts on the MS website you have to create License Objects and I am just wondering whether you have to create license objects each time?

  12. #12
    funkyfin2000's Avatar
    Join Date
    Sep 2008
    Location
    Stafford, Staffordshire
    Posts
    138
    Thank Post
    56
    Thanked 28 Times in 26 Posts
    Rep Power
    16
    We do this for all our 170 schools - disabled Lync and Exchange.

    We have to run a script of powershell every week or so, as new accounts being created in the tenancies by the provisioning methods we use (RM Unify from MIS and AD in the cloud) get the licences automatically assigned, but it's an easy job to do.

    If you want info on the script I can post it up I'm sure...need to speak to my techie team!

  13. #13

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    6,875
    Thank Post
    393
    Thanked 581 Times in 532 Posts
    Rep Power
    173
    Quote Originally Posted by funkyfin2000 View Post
    We do this for all our 170 schools - disabled Lync and Exchange.

    We have to run a script of powershell every week or so, as new accounts being created in the tenancies by the provisioning methods we use (RM Unify from MIS and AD in the cloud) get the licences automatically assigned, but it's an easy job to do.

    If you want info on the script I can post it up I'm sure...need to speak to my techie team!
    Be interesting to see your script. What do you use Office365 for then exactly?

  14. #14
    the_dude's Avatar
    Join Date
    Nov 2012
    Location
    SoCal
    Posts
    78
    Thank Post
    0
    Thanked 15 Times in 10 Posts
    Rep Power
    5
    What do you use Office365 for then exactly?
    lol, X2

  15. #15
    funkyfin2000's Avatar
    Join Date
    Sep 2008
    Location
    Stafford, Staffordshire
    Posts
    138
    Thank Post
    56
    Thanked 28 Times in 26 Posts
    Rep Power
    16
    Well - completed our first course today for SharePoint 2013 (amongst other things)

    We use RM Unify (Discover: RM Unify) to provision our accounts in to Office 365..... We also have the RM Site Creator tool for Office 365 which makes things is SharePoint so much easier to set up!

    Since our schools had a SharePoint based Learning Platform previously this is a natural (and very well received today (bar no parent access and the Newsfeed issue!!)) progression for them.

    We will then be releasing Office 365 Exchange to them very shortly (currently disabled via script as per this thread) until we are ready to release.... after that we plan to bring them on board with Lync and give them the more advanced features!

    Large scale project! Good fun but challenging!

    Rich

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. GPO to remove printer properites
    By eejit in forum Windows
    Replies: 15
    Last Post: 21st May 2009, 02:27 PM
  2. Batch file to remove registry key doesnt work
    By sidewinder in forum Windows
    Replies: 4
    Last Post: 7th December 2007, 04:48 PM
  3. Command to lookup public IP
    By thegrassisgreener in forum Windows
    Replies: 5
    Last Post: 4th December 2007, 01:31 PM
  4. Replies: 0
    Last Post: 20th August 2007, 02:20 PM
  5. Replies: 5
    Last Post: 19th October 2006, 02:08 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
  •