+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
Cloud Services Thread, powershell command to remove Lync in Technical; Will ask my engineers to get me the script.....and post it up .......
  1. #16
    funkyfin2000's Avatar
    Join Date
    Sep 2008
    Location
    Stafford, Staffordshire
    Posts
    142
    Thank Post
    56
    Thanked 28 Times in 26 Posts
    Rep Power
    16
    Will ask my engineers to get me the script.....and post it up ....

  2. #17
    funkyfin2000's Avatar
    Join Date
    Sep 2008
    Location
    Stafford, Staffordshire
    Posts
    142
    Thank Post
    56
    Thanked 28 Times in 26 Posts
    Rep Power
    16
    So this script is used for the exchange side of things:

    #Connect to O365

    connect-MsolService

    #Export all student users

    Get-MsolUser -All | Where-Object { $_.Licenses[0].AccountSkuId -match "FACULTY" } | Export-Csv "C:\students.csv"

    #Export all staff users

    Get-MsolUser -All | Where-Object { $_.Licenses[0].AccountSkuId -match "FACULTY" } | Export-Csv "C:\staff.csv"

    #variable to import student csv

    $students = Import-Csv "c:\students.csv"

    #variable to import staff csv

    $staff = Import-Csv "c:\staff.csv"

    # Office365 A2 Plans
    # SHAREPOINTWAC_EDU (SharePoint Online Web Apps)
    # MCOSTANDARD (Lync Online)
    # SHAREPOINTSTANDARD_EDU (Sharepoint Online)
    # EXCHANGE_S_STANDARD (Exchange Online
    #Variables to disable Exchange plan for student and staff

    $NoExch = New-MsolLicenseOptions -AccountSkuId "LaunchPad365Demo:STANDARDWOFFPACK_STUDENT" -DisabledPlans EXCHANGE_S_STANDARD
    $NoExch2 = New-MsolLicenseOptions -AccountSkuId "LaunchPad365Demo:STANDARDWOFFPACK_FACULTY" -DisabledPlans EXCHANGE_S_STANDARD

    #Apply plans to students

    $students | ForEach-Object {Get-MsolUser -UserPrincipalName $_.UserPrincipalName} | Set-MsolUserLicense -LicenseOptions $NoExch

    #Apply plans to staff

    $staff | ForEach-Object {Get-MsolUser -UserPrincipalName $_.UserPrincipalName} | Set-MsolUserLicense -LicenseOptions $NoExch2

    To turn off Lync:

    To disable Lync the plan is called MCOSTANDARD so in the code you would just replace EXCHANGE_S_STANDARD with MCOSTANDARD

    If you want to disable Exchange and Lync you would change it to EXCHANGE_S_STANDARD,MCOSTANDARD

    Hope that helps some people or maybe that isn't the best way of doing it! Suggestions and support always welcome

    Rich

  3. #18

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,114
    Thank Post
    403
    Thanked 619 Times in 566 Posts
    Rep Power
    180
    Just coming back to this.

    Code:
    #Export all student users
    
     Get-MsolUser -All | Where-Object { $_.Licenses[0].AccountSkuId -match "FACULTY" } | Export-Csv "C:\students.csv"
    
     #Export all staff users
    
     Get-MsolUser -All | Where-Object { $_.Licenses[0].AccountSkuId -match "FACULTY" } | Export-Csv "C:\staff.csv"
    Does FACULTY need to be replaced with something, else that will both bring back the same for staff and students?

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

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
  •