This guide includes the following:
- Adding a user to a specific routing policy
- Assigning a phone number to a user
- Assigning CallerID to a user
- Removing a phone number from a user
Open Windows PowerShell as admin.
Start menu -> Enter: ‘Windows PowerShell’ -> Right click -> Select ‘Run as administrator’
Or
Right click Start Menu -> Select Windows Powershell (Admin)
Within Windows PowerShell. Connect to Exchange through the command below:
‘Connect-ExchangeOnline’ Another window will appear asking you to sign into O365. Sign in with your 0365-admin account
After signing in, Windows PowerShell will display a blue bar on the top displaying that it is trying to connect to Exchange.
Note: There is a bug where the blue display will not appear, and it will not connect to Exchange. It will just sit and do nothing. Restart Windows PowerShell and try to re-connect again. You also may need to press ‘Enter’ after to display the input line. See below:
Once connected to Exchange, connect to Microsoft Teams through the command below:
‘Connect-Microsoft Teams’
Another Window will pop up asking you to sign in.
After signing in, Windows PowerShell will display the account, environment, and tenant ID that you have signed into Microsoft Teams with.
See this guide if the above modules are not installed: Install Exchange Online Module & Microsoft Teams PowerShell V3 / 03.04.2023 | D:\domain\daffyduck.tech
Before we can start adding and removing phone numbers, make sure that you have the below on hand:
- User’s O365 email address.
- User’s Phone Number in the +44 format.
- Policy Name (Users are added in ‘No Restrictions’ by default. If you have a specific policy you want to add them into, then you need to put them in manually)
- Phone Number Type. For example: DirectRouting.
Adding a user to a specific Voice Routing Policy:
- Grant-CsOnlineVoiceRoutingPolicy -Identity “UserEmail” -PolicyName “PolicyName”
Example Use:
- Grant-CsOnlineVoiceRoutingPolicy -Identity “[email protected]” -PolicyName “No Restrictions”
Assigning a phone number to a user:
- Set-CsPhoneNumberAssignment -Identity “UserEmail” -PhoneNumber +44PhoneNumber -PhoneNumberType PhoneNumberType
Example Use:
- Set-CsPhoneNumberAssignment -Identity “[email protected]” -PhoneNumber +44PhoneNumber -PhoneNumberType DirectRouting
Assigning CallerID to a user: (Used if there is a policy in place which forces a specific number to display to external users when the user makes a call)
- Grant-CsCallingLineIdentity -Identity “UserEmail” -PolicyName “PolicyName”
Set Policy Name as ‘Global’ if you wish the user to show their Direct Dial. This set by default.
Example Use:
- Grant-CsCallingLineIdentity -Identity ” [email protected] ” -PolicyName “Global”
Removing a phone number from a user:
- Remove-CsPhoneNumberAssignment -Identity “UserEmail” -RemoveAll
Example Use:
- Remove-CsPhoneNumberAssignment -Identity “[email protected]” -RemoveAll
If you wish to view all the current information assigned to the user such as their phone number and calling routing, then you can use the below command:
- Get-CSOnlineUser -Identity “UserEmail”