How to add licenses to Office 365 users

I need to add licenses to Office 365 users, but I do NOT want to add a license for Lync.  I have a script file for doing this, but I believe it will add all licenses including Lync.  I'm thinking I would first give the licenses, like this...

Set-MsolUserLicense -UserPrincipalName $_.EmailAddress -AddLicenses $AccountSkuId

Then remove the license for Lync?
New-MsolLicenseOption -AccountSkuId Contoso:BPOS_STANDARD -DisabledPlans LYNC_STUDENT

Is this the way to do it?  If so, I'm sure the disable command I have is incorrect so what would the command be to remove Lync?  Please no links to websites, I am looking for the actual command.

Thanks,
BPL
LVL 5
bpl5000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SubsunCommented:
Try..
$AccountSkuId  = New-MsolLicenseOptions -AccountSkuId Contoso:BPOS_STANDARD -DisabledPlans LYNC_STUDENT
Set-MsolUserLicense -UserPrincipalName User@domain.com -AddLicenses $AccountSkuId 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bpl5000Author Commented:
Is LYNC_STUDENT correct?  I was just guessing at that.  I searched on the web, but could only fine examples of removing Exchange or SharePoint.
0
SubsunCommented:
You can check the correct service plan name from BPOS_STANDARD.. Run..
Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq 'BPOS_STANDARD'} | % {$_.ServiceStatus}

Open in new window

0
Redefine Your Security with AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Check out our on-demand webinar to learn more about how AI can help your organization!

bpl5000Author Commented:
When I run that command, it just returns to prompt without any output.
0
SubsunCommented:
Run Get-MsolAccountSku | ft accountskuid,skupartnumber

and replace BPOS_STANDARD with correct part number in previous command..

BTB, If i remember the lync online plan name is MCOSTANDARD...
0
bpl5000Author Commented:
You're right... it is MCOSTANDARD.  Thanks!
0
bpl5000Author Commented:
So using these two commands (replaced with my info)...
$AccountSkuId  = New-MsolLicenseOptions -AccountSkuId Contoso:BPOS_STANDARD -DisabledPlans MCOSTANDARD
Set-MsolUserLicense -UserPrincipalName User@domain.com -AddLicenses $AccountSkuId

I get an error that the license is invalid.  When I type "Write-Host $AccountSkuID", it shows this:
Microsoft.Online.Administration.LicenseOption

I tried a few different things, but can't seem to get the license option to work.  If I leave out the license option, it works (proving that the sku is fine), but of course it gives the user Lync.  What am I doing wrong?
0
bpl5000Author Commented:
This works...
$options = New-MsolLicenseOptions -AccountSkuId ***:STANDARDWOFFPACK_STUDENT -DisabledPlans MCOSTANDARD
Set-MsolUserLicense -UserPrincipalName username@domain.org -AddLicenses ***:STANDARDWOFFPACK_STUDENT -LicenseOptions $options
0
bpl5000Author Commented:
Made a minor alteration...
$options = New-MsolLicenseOptions -AccountSkuId Contoso:BPOS_STANDARD -DisabledPlans MCOSTANDARD
$AccountSkuId  = New-MsolLicenseOptions -AccountSkuId Contoso:BPOS_STANDARD
Set-MsolUserLicense -UserPrincipalName User@domain.com -AddLicenses $AccountSkuId -LicenseOptions $options
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Office 365

From novice to tech pro — start learning today.