top of page
Search

Do You have troubles using Set-CsUser ?

Seems like this week is already full with many PowerShell error ( Unable to add numbers , big delay for sync ...), those coming from using the well Known Set-CsUser for affecting Direct routing or calling plan numbers .





Microsoft recommends administrators to update MicrosoftTeams Module on powershell and begin to use the new cmdlet : Set-CsPhoneNumberAssignment .


Note: The cmdlet is currently not supported for customers and tenants that are or have been enabled for Regionally Hosted Meetings for Skype for Business Online. These customers should continue to use the Set-CsUser, Set-CsOnlineVoiceUser, Set-CsOnlineApplicationInstance, or Set-CsOnlineVoiceApplicationInstance cmdlets.



This cmdlet will assign a phone number to a user or a resource account (online application instance).


This cmdlet assigns a phone number to a user or resource account. When you assign a phone number the EnterpriseVoiceEnabled flag is automatically set to True.

To remove a phone number from a user or resource account, use the Remove-CsPhoneNumberAssignment cmdlet.

If the cmdlet executes successfully, no result object will be returned. If the cmdlet fails for any reason, a result object will be returned that contains a Code string parameter and a Message string parameter with additional details of the failure.



Example :


Set-CsPhoneNumberAssignment -Identity user1@anasstechtime.com -PhoneNumber +212XXXXXXX -PhoneNumberType CallingPlan (Or direct routing)


Note that : The cmdlet is available in Teams PowerShell module 3.0.0 or later.

If a user or resource account has a phone number set in Active Directory on-premises and synched into Microsoft 365, you can't use Set-CsPhoneNumberAssignment to set the phone number. You will have to clear the phone number from the on-premises Active Directory and let that change sync into Microsoft 365 first.

The previous command for assigning phone numbers to users Set-CsUser had the parameter HostedVoiceMail. Setting HostedVoiceMail for Microsoft Teams users is no longer necessary and that is why the parameter is not available on Set-CsPhoneNumberAssignment.

15 views0 comments
bottom of page