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.
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 - Jul 25, 2020Yup! “ $User.SipAddress” means selecting the “sipaddress” field in the CSV for every user the scripts loops through, so in this case header must be sipaddress