How to assing office 365 F3 teams only license with powershell, can anyone give me the script

Kondukuri Sai Saketh 21 Reputation points
2022-01-12T20:39:53.627+00:00

How to assign office 365 F3 teams only license with PowerShell, can anyone give me the script

Exchange | Exchange Server | Management
{count} votes

Accepted answer
  1. Joyce Shen - MSFT 16,701 Reputation points
    2022-01-20T07:29:17.453+00:00

    Hi @Kondukuri Sai Saketh

    Sorry for my misunderstanding. If so, we could refer to the introduction in the official document: Disable access to Microsoft 365 services with PowerShell, We could disable all other servies except for teams related then assign them to users.

    1.Identify the undesired services in the licensing plan by using the following syntax:

    $LO = New-MsolLicenseOptions -AccountSkuId <AccountSkuId> -DisabledPlans "<UndesiredService1>", "<UndesiredService2>"...  
    

    Example: The following example creates a LicenseOptions object that disables the Office and SharePoint Online services in the licensing plan named litwareinc:ENTERPRISEPACK (Office 365 Enterprise E3).

    $LO = New-MsolLicenseOptions -AccountSkuId "litwareinc:ENTERPRISEPACK" -DisabledPlans "SHAREPOINTWAC", "SHAREPOINTENTERPRISE"  
    

    2.Use the LicenseOptions object from Step 1 on one or more users.
    To disable the services for an existing licensed user, use the following syntax:

    Set-MsolUserLicense -UserPrincipalName <Account> -LicenseOptions $LO  
    

    To create a new account that has the services disabled, use the following syntax:

    New-MsolUser -UserPrincipalName <Account> -DisplayName <DisplayName> -FirstName <FirstName> -LastName <LastName> -LicenseAssignment <AccountSkuId> -LicenseOptions $LO -UsageLocation <CountryCode>  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Joyce Shen - MSFT 16,701 Reputation points
    2022-01-13T01:33:52.067+00:00

    Hi @Kondukuri Sai Saketh

    To connect to O365/MSOnline, use the following command:

    Import-Module MSOnline  
    Connect-MsolService  
    

    Then we could use the command below to get a list of licenses available in your tenant. It is identified by the AccountSkuID in PowerShell.

    Get-MsolAccountSku  
    

    To assign a license to a user, use the following command in PowerShell.
    Set-MsolUserLicense -UserPrincipalName "<Account>" -AddLicenses "<AccountSkuId>"

    For Example:

    Set-MsolUserLicense -UserPrincipalName "******@litwareinc.com" -AddLicenses "litwareinc:ENTERPRISEPACK"  
    

    To assign a license to all unlicensed users, run this command.

    Get-MsolUser -All -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "litwareinc:ENTERPRISEPACK"  
    

    For detailed information, we could refer to the official document:
    Use the Microsoft Azure Active Directory Module for Windows PowerShell

    And this guide provided steps and screenshots
    Bulk Assign Licenses in Office 365 Using PowerShell
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.