Forum Discussion

Chad Rodriguez's avatar
Chad Rodriguez
Copper Contributor
Sep 11, 2019
Solved

Move some users to "Teams Only" mode with powershell

Does anyone have a script that will move users in bulk from islands mode to ms teams only please?
  • This is a simple script that reads sip address from a csv file and change mode.

     

    $Users = Import-Csv -Path c:\temp\users.csv
    
    foreach($User in $Users)
    {
    
    Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams
    
    }

     

    If you want to change for all users in your organisation you can change the default mode instead. Teams Admin Center > Org-wide Settings > Teams Upgrade, change Coexistence mode to Teams only.

  • This is a simple script that reads sip address from a csv file and change mode.

     

    $Users = Import-Csv -Path c:\temp\users.csv
    
    foreach($User in $Users)
    {
    
    Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams
    
    }

     

    If you want to change for all users in your organisation you can change the default mode instead. Teams Admin Center > Org-wide Settings > Teams Upgrade, change Coexistence mode to Teams only.

    • NARASA SARAT MEDAPALLI's avatar
      NARASA SARAT MEDAPALLI
      Copper Contributor

      LinusCansby What should be the .csv file look like. I used the userpricipalname in tab and the user name below it? That did not help me. Please share if there is an example file. Thanks

    • Ram_vignesh1987's avatar
      Ram_vignesh1987
      Copper Contributor

       

      LinusCansby 

       

      PS C:\Users\Ram_Vignesh> cd c:\
      PS C:\> $Users = Import-Csv -Path c:\users.csv
      PS C:\> foreach($User in $Users)
      >> { Grant-CsTeamsUpgradePolicy -Identity $User. UserPrincipalName -PolicyName UpgradeToTeams }
      Grant-CsTeamsUpgradePolicy : The term 'Grant-CsTeamsUpgradePolicy' is not recognized as the name of a cmdlet,
      function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
      path is correct and try again.
      At line:2 char:3
      + { Grant-CsTeamsUpgradePolicy -Identity $User. UserPrincipalName -Poli ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : ObjectNotFound: (Grant-CsTeamsUpgradePolicy:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

       

       

      facing the error could tell me the reason for the error 

      • NARASA SARAT MEDAPALLI's avatar
        NARASA SARAT MEDAPALLI
        Copper Contributor
        foreach($User in $Users)
        {
        Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName UpgradeToTeams
        }
        Cannot validate argument on parameter 'Identity'. The argument is null or empty. Provide an argument that is not null or empty, and
        then try the command again.
        + CategoryInfo : InvalidData: (:) [Grant-CsTeamsUpgradePolicy], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Rtc.Management.AD.Cmdlets.AssignCSTeamsUpgradePolicyCmdlet
        + PSComputerName : admin3a.online.lync.com

Resources