Forum Discussion
Microsoft Teams PowerShell Module V2.3 - Set-CsUser broken!
- Apr 30, 2021
We had the same issue today and this is how we got round it:
- Run a PS session as Admin
- Uninstall-Module -Name MicrosoftTeams
- Install-Module -Name MicrosoftTeams -RequiredVersion 2.0.0
- Import-Module -Name MicrosfTeams
This then allowed us to progress and use the Set-CsUser command.
Markus_Hupfauer It seems to be fixed in v2.3.1 that has just been released.
https://www.powershellgallery.com/packages/MicrosoftTeams/2.3.1
- CSkovgaardMay 10, 2021Copper ContributorYes it does 🙂 but apparently some arguments are still broken, but it's at least better than the previous release.
- dave_middMay 10, 2021Copper Contributor
Oh dear. Any ideas which ones?
This seemed to execute ok, without any errors:
Set-CsUser -Identity user@doamin.com -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI "tel:+1234567890"
Note they've gone back to using -Identity !
- SivanandanRDec 13, 2021Copper Contributor
I came across the scenario where we move the user from Online To onpremises. After few days we again try to move the user from onpremises to online. When we do this operation it works for few case but few case it get failed. After failure the number also get sync to online.
Exception:System.Management.Automation.RemoteException: Can not update OnPremLineURI as the user has dirsynced onpremise LineURI.InnerException:
What's wrong with the command and I don't know how to troubleshoot this issue.
Plz help.
ONPREM OnPremScript Execution:Move-CsUser -Identity "YYYYYY@XXXX.com.sg" -Target "sipfed.online.lync.com" -HostedMigrationOverrideUrl "https://admin0f.online.lync.com/HostedMigration/hostedmigrationservice.svc" -DomainController "SP-IS-AD01" -Confirm:$false -UseOAuth -Credential $c OnPremScript Execution:Set-CsUser -Identity "YYYYYY@XXXX.com.sg" -EnterpriseVoiceEnabled $true -LineURI "tel:+6569167308;ext=7308" OnPremScript Execution:Grant-CsVoicePolicy -Identity "YYYYYY@XXXX.com.sg" -PolicyName $null OnPremScript Execution:Grant-CsVoiceRoutingPolicy -Identity "YYYYYY@XXXX.com.sg" -PolicyName $null OnPremScript Execution:Grant-CsDialPlan -Identity "YYYYYY@XXXX.com.sg" -PolicyName $null ONLINE OnLine Execution Script:Grant-CsTenantDialPlan -identity "YYYYYY@XXXX.com.sg" -policyname "AA-DialPlan-Teams" OnLine Execution Script:Grant-CsOnlineVoiceRoutingPolicy -Identity "YYYYYY@XXXX.com.sg" -PolicyName "VP-AA-Teams-Local" OnLine Execution Script:Grant-CsTeamsUpgradePolicy -Identity "YYYYYY@XXXX.com.sg" -PolicyName UpgradeToTeams OnLine Execution Script:Set-CsUser -Identity "YYYYYY@XXXX.com.sg" -EnterpriseVoiceEnabled $true -OnPremLineURI "tel:+65XXXX7308;ext=7308" -HostedVoiceMail $true PowerShellErrorCheck: Powershell Invoke Error: Exception:System.Management.Automation.RemoteException: Can not update OnPremLineURI as the user has dirsynced onpremise LineURI.InnerException: