Forum Discussion
Move some users to "Teams Only" mode with powershell
- Sep 11, 2019
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 MEDAPALLIJul 23, 2020Copper 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
- LinusCansbyJul 25, 2020MVP
Header with SipAddress and then one sip address per row:
SipAddress
user1@contoso.comuser2@contoso.com
- avieira094Mar 30, 2021Copper ContributorHi Linus Cansby
First thanks for sharing your knowledge,
my csv file is as you described
SipAddress
user1@contoso.com
user2@contoso.com
But when I run on the powershell it generates the message below:
Cannot convert 'user1@contoso.com user2@contoso.com' to the type
'Microsoft.Rtc.Management.AD.UserIdParameter' required by parameter 'Identity'. Specified method is not supported.
+ CategoryInfo : InvalidArgument: (:) [Grant-CsTeamsUpgradePolicy], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Rtc.Management.AD.Cmdlets.AssignCSTeamsUpgradePolicyCmdl
et
+ PSComputerName : api.interfaces.records.teams.microsoft.com
- Ram_vignesh1987May 15, 2020Copper Contributor
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 : CommandNotFoundExceptionfacing the error could tell me the reason for the error
- NARASA SARAT MEDAPALLIJul 24, 2020Copper Contributorforeach($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 - LinusCansbyMay 18, 2020MVP
Ram_vignesh1987 Check this document to download Skype for Business Online powershell module and then how to connect to SfB Online to run the command.
- Ram_vignesh1987May 14, 2020Copper Contributor
can you send me to my email address mailto:ramece1987@gmail.com for the further explaination i want to complete the 100 user to activat teams useing powershell script
- Ram_vignesh1987May 14, 2020Copper Contributor
LinusCansby same way i am getting error i want to know from which machine i want run the script
- LinusCansbyMay 14, 2020MVP
Ram_vignesh1987 If you are moving from Skype for Business Online to Teams you can run it from any machine, just connect to Skype for Business Online Powershell.
- Ram_vignesh1987May 15, 2020Copper Contributor
Do we first connect o365 in powershell then run the script in the powershell even i am not able to find
- Chad RodriguezSep 11, 2019Copper ContributorFigured it out Linus, but what if i want to notify the Skype for Business user? #Connect using a Skype for Business Online administrator account with multifactor authentication Import-Module SkypeOnlineConnector $sfbSession = New-CsOnlineSession Import-PSSession $sfbSession $Users = Import-Csv -Path c:\temp\TeamsOnlyMode.csv foreach($User in $Users) { Grant-CsTeamsUpgradePolicy -Identity $User.UserPrincipalName -PolicyName UpgradeToTeams }
- LinusCansbySep 11, 2019MVP
Hi,
Great that you figured it out.
You can't set the notify user switch when switching them to TeamsOnly, since when they are in TeamsOnly mode they will not use the Skype client anymore. So that you have to inform them about with a good user adoption.
- Chad RodriguezSep 12, 2019Copper ContributorJust wondering what that switch looks like, do you happen to know please?
- Chad RodriguezSep 11, 2019Copper ContributorLinus will this work if i have a current csv with a column titled: UserPrincipalName username@company.com ?
- Chad RodriguezSep 11, 2019Copper ContributorI get this error: $Users = Import-Csv -Path c:\temp\TeamsOnlyMode.csv foreach($User in $Users) { Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -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:6 char:1 + Grant-CsTeamsUpgradePolicy -Identity $User.SipAddress -PolicyName Upg ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Grant-CsTeamsUpgradePolicy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException