microsoft teams phone · published

Teams voice administration with PowerShell

Verified 2026-09-25 · 60 sources · tier 2–3 · 2 disputed

Also known as MicrosoftTeams PowerShell module, TPM, Teams PowerShell Module.

Disputed: 2 sources below carry conflicting evidence.

The MicrosoftTeams PowerShell module provides cmdlets for configuring voice routing, phone number assignments, and user policies in Microsoft Teams 51​8. Only module versions in the 4.x.x series or later are supported, while all earlier versions are fully retired 56.

Module Requirements and Connection

The MicrosoftTeams PowerShell module requires Windows PowerShell 5.1 or PowerShell 7.2 or later 36. Microsoft recommends installing the module from the PowerShell Gallery using Install-Module -Name MicrosoftTeams 28. The module should be updated using the same method chosen for installation; when installed through Install-Module, it is updated using Update-Module MicrosoftTeams 59. Updating the module fails if it is already imported into the active session, and Microsoft instructs administrators to close PowerShell and open a new elevated session prior to running the update 58.

From module 7.8.1-preview, interactive user sign-in on Windows uses Web Account Manager (WAM) 9. The -DisableWAM parameter provides a temporary workaround for execution contexts such as RunAs or a Task Scheduler task configured to run whether or not the user is logged on 9.

Application-based authentication using service principals is supported from version 4.7.1-preview in commercial and GCC environments, and from version 5.0.1-preview in GCC High and DoD 3. For application-based authentication, Microsoft states that administrators should not configure a 'Skype and Teams Tenant Admin API' permission, as doing so may cause failures 2. Session role-based access control (RBAC) is derived from the Entra directory role assigned to the application 2. With application-based authentication, all cmdlets are supported except a designated list: the voice-relevant exceptions are Set-CsOnlineApplicationInstance across all environments, as well as Get-CsOnlineApplicationInstance, New-CsOnlineApplicationInstance, and Sync-CsOnlineApplicationInstance in GCC High and DoD 1.

Phone Number Assignment and Management

Set-CsPhoneNumberAssignment assigns a phone number to a user or resource account and automatically sets EnterpriseVoiceEnabled to True 51. The cmdlet was introduced in module 3.0.0, while the -Notify parameter was added in 7.3.0 and alternate number assignment in 7.6.0 53. Set-CsPhoneNumberAssignment is available only in the commercial, GCC, GCC High, and DoD cloud instances 43.

In its Assignment parameter set, the -NumberType parameter is mandatory and accepts DirectRouting, CallingPlan, or OperatorConnect 49. The -TelephoneNumber parameter accepts E.164 formats (+12065551234) and non-E.164 formats (12065551234), but does not accept a tel: prefix 48. Direct Routing numbers with extensions can be assigned using the syntax +1206555000;ext=1234 or 1206555000;ext=1234 44. Non-primary numbers can be designated using -AssignmentCategory, which accepts Private for an incoming-calls-only private line or Alternate for an alternate line 42.

To remove an emergency location from a phone number, administrators pass the string 'null' to -LocationId, which is supported for Direct Routing numbers and Operator Connect numbers not managed by the Service Desk 45. Setting -ReverseNumberLookup SkipInternalVoip on a Direct Routing number causes internal calls directed to that number to route across external PSTN connectivity rather than resolving internally via VoIP reverse number lookup 52. For bulk number updates, Microsoft documents a pattern using a foreach loop over Get-CsPhoneNumberAssignment results to call Set-CsPhoneNumberAssignment with -ErrorAction Stop inside a Try/Catch block for each number 41.

Set-CsPhoneNumberAssignment cannot assign a number to an account if the number is defined in on-premises Active Directory and synchronized to Microsoft 365; the value must first be cleared on premises and synchronized 50.

Removing number assignments is handled by Remove-CsPhoneNumberAssignment, which automatically sets EnterpriseVoiceEnabled to False 39. The unassigned number remains in the tenant inventory unless an assignment block is specified 39. Starting in module 7.5.0, reassignment blocks can be applied indefinitely using -AssignmentBlockedForever or for 1 to 365 days using -AssignmentBlockedDays 37. All numbers can be removed from a user or resource account at once using Remove-CsPhoneNumberAssignment -RemoveAll without specifying individual numbers or types 40. From version 4.2.1-preview, Remove-CsPhoneNumberAssignment reports failures as exceptions added to $Error and obeys -ErrorAction, rather than outputting a result object with Code and Message 38.

Using Set-CsUser for Microsoft Teams users in commercial and GCC environments is deprecated in favor of Set-CsPhoneNumberAssignment and Remove-CsPhoneNumberAssignment, including for configuring -EnterpriseVoiceEnabled and -OnPremLineURI 54. For GCC High and DoD environments, documentation for Set-CsUser still outlines -LineURI for assigning Direct Routing numbers and notes that -OnPremLineURI is deprecated in favor of -LineURI 55.

Inventory and User Discovery

Get-CsPhoneNumberAssignment returns a maximum of 500 results by default, though -Top can increase the page size to 1000 16. Working with larger data sets requires manual paging with -Skip and -Top or asynchronous export through Export-CsAcquiredPhoneNumber 16. WarmTransfer's reading of the sources is that audit scripts calling Get-CsPhoneNumberAssignment without paging or export logic will retrieve at most 500 numbers, resulting in silent undercounting in larger environments without triggering an error 4. Get-CsPhoneNumberAssignment was introduced in module 4.0.0; the AssignmentBlockedState and AssignmentBlockedUntil properties were added in 7.5.0, and SmsActivationState was added in 7.7.0 19.

When filtering with Get-CsPhoneNumberAssignment -CapabilitiesContain using a comma-separated list, the query returns only numbers that match all listed capabilities rather than any single match 15. The -AssignedPstnTargetId parameter searches for numbers assigned to a specific user or resource account and accepts a UPN, SIP address, ObjectId, or a Teams shared calling routing policy instance name 18. The NumberSource property indicates whether a number was assigned directly in Microsoft 365 (Online) or synced from on-premises Active Directory (OnPremises); this property was introduced in module 5.7.0 17. In commercial and GCC environments, tenant-wide number lists can be exported asynchronously using Export-CsAcquiredPhoneNumber, which returns an OrderId tracked via Get-CsExportAcquiredPhoneNumberStatus for status and download links 13. Older inventory cmdlets, including Search-CsOnlineTelephoneNumberInventory and Get-CsOnlineTelephoneNumberInventoryCities, are deprecated, with New-CsOnlineTelephoneNumberOrder suggested as a replacement 12.

Get-CsOnlineVoiceUser is deprecated in commercial and GCC environments 11. In Get-CsOnlineUser, several voice attributes have changed across module releases: 22​23​24​20​21

  • The FeatureTypes array (containing values such as PhoneSystem, CallingPlan, AudioConferencing, and VoiceApp) was introduced in module 3.0.0 to replace dropped attributes like VoicePolicy, and can be filtered using -Contains starting in 4.0.0 22.
  • Direct Routing numbers are listed under LineURI and distinguished from Calling Plan numbers via FeatureTypes; OnPremLineURI strictly represents values set in on-premises Active Directory 23.
  • Starting in module 7.0.0 across all clouds, OptionFlags is no longer populated; administrators must inspect EnterpriseVoiceEnabled instead 24.
  • The DialPlan attribute is deprecated and no longer populated in any cloud 20.
  • In commercial environments starting in 7.1.1 Preview, the EffectivePolicyAssignments attribute displays each policy type's effective assignment and clarifies whether it is direct or group-derived 21.

Normalization rules can be tested using Test-CsEffectiveTenantDialPlan, which applies the rules from a user's effective tenant dial plan to a value passed to -DialedNumber, commonly by piping from Get-CsEffectiveTenantDialPlan -Identity <user> 57.

Policy Assignment and Precedence

Policies can be assigned to batches of up to 5,000 users at a time using New-CsBatchPolicyAssignmentOperation, which executes asynchronously and returns an operation ID 5. Users must be targeted using their object ID or SIP address; supplying a UPN that does not match the user's SIP address causes the assignment to fail 6. Status and individual user failures can be queried using Get-CsBatchPolicyAssignmentOperation -OperationId by reviewing the UserState property 7. Voice policy types supported by batch operations include OnlineVoiceRoutingPolicy, TenantDialPlan, TeamsCallingPolicy, CallingLineIdentity, TeamsCallParkPolicy, TeamsEmergencyCallingPolicy, and TeamsEmergencyCallRoutingPolicy 8.

Policy inheritance follows specific precedence rules: 26

Assignment Level Behavior and Precedence
Direct Assignment Takes precedence over group assignments of the same policy type 26.
Group Assignment Resolves conflicts by group ranking where 1 is the highest rank 26. Applies only to direct group members 25.
Global Default Applies automatically to users who have neither a direct nor a group assignment 26.

Group assignments do not propagate to members of nested groups 25. Microsoft recommends group assignments for groups of up to 50,000 users; changes propagate in the background over a duration determined by group size 27. Running Get-CsUserPolicyAssignment -PolicyType <type> and inspecting the expanded PolicySource attribute reveals whether a user's effective policy is Direct or inherited from a Group 35.

For voice routing specifically, Grant-CsVoiceRoutingPolicy and Get-CsVoiceRoutingPolicy are not supported or relevant for Microsoft Teams scenarios; the Cs*OnlineVoiceRoutingPolicy cmdlets must be used instead 10. Group assignments using Grant-CsOnlineVoiceRoutingPolicy with -Group and -Rank are available from module 4.5.1-preview 32. Running Grant-CsOnlineVoiceRoutingPolicy -Identity <user> -PolicyName $null clears a per-user policy assignment; the user then falls back to any group-assigned policy, or to the global policy if none applies 34. A global default can be established across the tenant for all users without explicit assignments using Grant-CsOnlineVoiceRoutingPolicy -PolicyName <name> -Global 31. An online voice routing policy assignment alone does not enable PSTN calling through Direct Routing; users must also be enabled for Phone System 33.

See also

Applicability

Applies to: MicrosoftTeams PowerShell module and Microsoft Teams. Deployments: hybrid and multi-tenant. Sources checked 2026-09-25. The MicrosoftTeams module requires PowerShell version 5.1 or version 7.2 or later 36. Only module versions in the 4.x.x series or later are supported 56. Set-CsPhoneNumberAssignment is restricted to commercial, GCC, GCC High, and DoD environments 43. Export-CsAcquiredPhoneNumber and the deprecation of Get-CsOnlineVoiceUser and Set-CsUser apply to commercial and GCC environments 13​11​54. Direct Routing assignment via Set-CsUser -LineURI remains documented specifically for GCC High and DoD environments 55.

What remains uncertain

Regarding the role of -NetworkSiteId in Set-CsPhoneNumberAssignment, sources disagree: in the Assignment parameter set, the reference describes it as the ID of a network site representing a physical venue such as an office, a set of buildings, or a campus, but the second -NetworkSiteId entry and the Get-CsPhoneNumberAssignment output say the parameter is reserved for internal Microsoft use 46​47.

See also

Related to

  • Teams location-based routing — Set-CsPhoneNumberAssignment and Get-CsPhoneNumberAssignment carry NetworkSiteId parameters; network sites are the LBR building block. Topic id taken from the sibling queue directory; relationship not recorded in corpus notes; proposed by this packet.

Referenced by

  • Microsoft Teams Cloud Voicemail — Voicemail is managed with CsOnlineVoicemailPolicy; CsOnlineVoicemailUserSettings and the CsTeamsCallingPolicy AllowVoicemail parameter
  • SIPREC call recording interface — Teams compliance recording is policy-driven and is the contrast case to SIPREC; it uses Graph-based recorder bots rather than SIPREC
  • Teams location-based routing — LBR is enabled through Set-CsTenantNetworkSite; Set-CsOnlinePSTNGateway and Teams calling policy PreventTollBypass

Sources

  1. 1
    With application-based authentication all cmdlets are supported except a listed set; the voice-relevant exceptions are Set-CsOnlineApplicationInstance everywhere, and Get, New and Sync-CsOnlineApplicationInstance in GCC High and DoD only.
    Application-based authentication in Teams PowerShell Module · Cmdlets Supported · Checked 2026-09-25
  2. 2
    For application-based authentication, Microsoft says not to configure a 'Skype and Teams Tenant Admin API' permission (doing so may cause failures); session RBAC comes from the Entra directory role assigned to the application.
    Application-based authentication in Teams PowerShell Module · How does it work?; Setup Application-based authentication, step 2 Note and step 5 · Checked 2026-09-25
  3. 3
    Application-based (service principal) authentication in the Teams PowerShell module is supported from 4.7.1-preview in commercial and GCC and from 5.0.1-preview in GCC High and DoD.
    Application-based authentication in Teams PowerShell Module · Opening bullets · Checked 2026-09-25
  4. 4
    An audit script that calls Get-CsPhoneNumberAssignment without -Top/-Skip paging or Export-CsAcquiredPhoneNumber will see at most 500 numbers, so in larger tenants it undercounts without raising an error.inferred
    Get-CsPhoneNumberAssignment (MicrosoftTeams) · Description, final paragraph · Checked 2026-09-25
  5. 5
    New-CsBatchPolicyAssignmentOperation assigns or unassigns a policy for up to 5,000 users per batch as an asynchronous operation and returns an operation ID.
    New-CsBatchPolicyAssignmentOperation (MicrosoftTeams) · Description, first and third paragraphs; Parameters, -Identity · Checked 2026-09-25
  6. 6
    New-CsBatchPolicyAssignmentOperation identifies users by object ID or SIP address; a user given by a UPN that differs from their SIP address fails policy assignment.
    New-CsBatchPolicyAssignmentOperation (MicrosoftTeams) · Description, second paragraph · Checked 2026-09-25
  7. 7
    The status of a batch policy assignment is read with Get-CsBatchPolicyAssignmentOperation -OperationId, and per-user errors are in its UserState property.
    Assign policies to users and groups · Assign a policy to a batch of users > Use PowerShell method > Get the status of a batch assignment · Checked 2026-09-25
  8. 8
    Voice-related policy types that New-CsBatchPolicyAssignmentOperation supports include OnlineVoiceRoutingPolicy, TenantDialPlan, TeamsCallingPolicy, CallingLineIdentity, TeamsCallParkPolicy, TeamsEmergencyCallingPolicy and TeamsEmergencyCallRoutingPolicy.
    New-CsBatchPolicyAssignmentOperation (MicrosoftTeams) · Description, list of supported policy types (final paragraph) · Checked 2026-09-25
  9. 9
    From module 7.8.1-preview, interactive user sign-in on Windows uses Web Account Manager (WAM); -DisableWAM is a temporary workaround for contexts such as RunAs or a Task Scheduler job set to run whether or not the user is logged on.
    Connect-MicrosoftTeams (MicrosoftTeams) · Notes, Updates in Teams PowerShell Module version 7.8.1-preview and later; Parameters, -DisableWAM · Checked 2026-09-25
  10. 10
    The Grant-CsVoiceRoutingPolicy and Get-CsVoiceRoutingPolicy cmdlets are listed as not supported or relevant for Microsoft Teams, unlike the Cs*OnlineVoiceRoutingPolicy cmdlets.
    Teams PowerShell Module - Supported Versions · Deprecated cmdlets, list of cmdlets that aren't supported/relevant for Microsoft Teams scenarios · Checked 2026-09-25
  11. 11
    Get-CsOnlineVoiceUser is deprecated in commercial and GCC environments.
    Teams PowerShell Module - Supported Versions · Deprecated cmdlets table, Get-CsOnlineVoiceUser row · Checked 2026-09-25
  12. 12
    The older telephone number inventory cmdlets (for example Search-CsOnlineTelephoneNumberInventory and Get-CsOnlineTelephoneNumberInventoryCities) are deprecated, and New-CsOnlineTelephoneNumberOrder is the suggested replacement.
    Teams PowerShell Module - Supported Versions · Deprecated cmdlets table, Get-CsOnlineTelephoneNumberInventory* row · Checked 2026-09-25
  13. 13
    Export-CsAcquiredPhoneNumber exports every number the tenant has acquired as an asynchronous operation that returns an OrderId; Get-CsExportAcquiredPhoneNumberStatus reports the status and the download link.
    Export-CsAcquiredPhoneNumber (MicrosoftTeams) · Description, first paragraph; Notes · Checked 2026-09-25
  14. 14
    For GCC High and DoD tenants, the reviewed documentation does not state whether Set-CsPhoneNumberAssignment or Set-CsUser -LineURI is the preferred way to assign Direct Routing numbers.inferred
    Set-CsUser (MicrosoftTeams) · Parameters, -LineURI, compared with Set-CsPhoneNumberAssignment Notes second paragraph · Checked 2026-09-25
  15. 15
    When Get-CsPhoneNumberAssignment -CapabilitiesContain is given a comma-separated list, it returns only numbers that have all of the listed capabilities, not any of them.
    Get-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -CapabilitiesContain; Example 3 · Checked 2026-09-25
  16. 16
    Get-CsPhoneNumberAssignment returns at most 500 results by default; -Top raises that to at most 1000, and larger sets must be paged with -Skip and -Top or exported with Export-CsAcquiredPhoneNumber.
    Get-CsPhoneNumberAssignment (MicrosoftTeams) · Description, final paragraph; Parameters, -Top; Example 8 · Checked 2026-09-25
  17. 17
    The NumberSource output of Get-CsPhoneNumberAssignment is Online for numbers assigned in Microsoft 365 and OnPremises for numbers assigned in on-premises AD and synced; it was introduced in module 5.7.0.
    Get-CsPhoneNumberAssignment (MicrosoftTeams) · Outputs, NumberSource; Notes · Checked 2026-09-25
  18. 18
    Get-CsPhoneNumberAssignment -AssignedPstnTargetId finds the number assigned to a user or resource account and accepts a UPN, SIP address, ObjectId or Teams shared calling routing policy instance name.
    Get-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -AssignedPstnTargetId; Examples 4, 5 and 9 · Checked 2026-09-25
  19. 19
    Get-CsPhoneNumberAssignment is available from module 4.0.0; the AssignmentBlockedState and AssignmentBlockedUntil outputs arrived in 7.5.0 and SmsActivationState in 7.7.0.
    Get-CsPhoneNumberAssignment (MicrosoftTeams) · Notes, first paragraph · Checked 2026-09-25
  20. 20
    The DialPlan attribute is deprecated and no longer populated in Get-CsOnlineUser output in any cloud.
    Get-CsOnlineUser (MicrosoftTeams) · Notes, Updates in Teams PowerShell Module (DialPlan bullet) · Checked 2026-09-25
  21. 21
    From module 7.1.1 Preview, in commercial environments, Get-CsOnlineUser includes an EffectivePolicyAssignments attribute that shows each policy type's assigned policy and whether the assignment is direct or group-based.
    Get-CsOnlineUser (MicrosoftTeams) · Notes, Updates in Teams PowerShell Module verion 7.1.1 Preview and later · Checked 2026-09-25
  22. 22
    From module 3.0.0, Get-CsOnlineUser exposes a FeatureTypes array (for example PhoneSystem, CallingPlan, AudioConferencing, VoiceApp) that replaces dropped attributes such as VoicePolicy; from 4.0.0 it can be filtered with -Contains.
    Get-CsOnlineUser (MicrosoftTeams) · Notes, Updates in Teams PowerShell Module version 3.0.0 and above > New user attributes; Example 7 · Checked 2026-09-25
  23. 23
    From module 3.0.0, the Get-CsOnlineUser OnPremLineURI attribute refers only to a LineURI set in on-premises AD; Direct Routing numbers appear in LineURI and are distinguished from Calling Plan numbers by FeatureTypes.
    Get-CsOnlineUser (MicrosoftTeams) · Notes, 3.0.0 and above > Attributes that have changed in meaning/format > OnPremLineURI · Checked 2026-09-25
  24. 24
    From module 7.0.0, Get-CsOnlineUser no longer populates OptionFlags; EnterpriseVoiceEnabled is the attribute to check instead.
    Get-CsOnlineUser (MicrosoftTeams) · Notes, Updates in Teams PowerShell Module version 7.0.0 and later · Checked 2026-09-25
  25. 25
    Group policy assignments propagate only to direct members of the group, not to members of nested groups.
    Assign policies to users and groups · Assign a policy to a group, sixth paragraph · Checked 2026-09-25
  26. 26
    A policy assigned directly to a user takes precedence over any group-assigned policy of the same type; among groups, the assignment with the highest ranking (lowest number, 1 is highest) wins; with neither, the Global (Org-wide default) policy applies.
    Assign policies to users and groups · Assign a policy to a group > What you need to know about policy assignment to groups > Precedence rules · Checked 2026-09-25
  27. 27
    Group policy assignment is recommended for groups of up to 50,000 users, and propagation to members runs as a background operation whose duration depends on group size.
    Assign policies to users and groups · Assign a policy to a group, fourth and fifth paragraphs · Checked 2026-09-25
  28. 29
    As of 2026-09-25, the latest MicrosoftTeams module version on the PowerShell Gallery is 8.0.0, published 2026-09-15.
    PowerShell Gallery | MicrosoftTeams · Version History table, top row · Checked 2026-09-25
  29. 30
    No batch cmdlet for number-to-user assignment comparable to New-CsBatchPolicyAssignmentOperation appears in the reviewed sources; the documented bulk pattern for assignment is a per-number loop.inferred
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Examples 8 and 10; Related Links · Checked 2026-09-25
  30. 31
    Grant-CsOnlineVoiceRoutingPolicy -PolicyName <name> -Global makes that policy the tenant-wide global policy, which applies to all users except those with an explicit assignment.
    Grant-CsOnlineVoiceRoutingPolicy (MicrosoftTeams) · Example 4; Parameters, -Global · Checked 2026-09-25
  31. 32
    Grant-CsOnlineVoiceRoutingPolicy supports group assignment with -Group and -Rank (the GrantToGroup syntax) from module 4.5.1-preview.
    Grant-CsOnlineVoiceRoutingPolicy (MicrosoftTeams) · Syntax, GrantToGroup; Example 5; Notes · Checked 2026-09-25
  32. 33
    Assigning an online voice routing policy alone does not enable a user to make PSTN calls through Direct Routing; the user must also be enabled for Phone System, among other steps.
    Grant-CsOnlineVoiceRoutingPolicy (MicrosoftTeams) · Description, second paragraph · Checked 2026-09-25
  33. 34
    Running Grant-CsOnlineVoiceRoutingPolicy -Identity <user> -PolicyName $null removes the per-user online voice routing policy, leaving the user on the global policy.
    Grant-CsOnlineVoiceRoutingPolicy (MicrosoftTeams) · Example 2; Parameters, -PolicyName · Checked 2026-09-25
  34. 35
    Get-CsUserPolicyAssignment -PolicyType <type>, expanding PolicySource, shows whether a user's policy is Direct or inherited from a Group, which explains why a group assignment is not taking effect.
    Assign policies to users and groups · Assign a policy to a group > Change the effective policy for a user · Checked 2026-09-25
  35. 36
    The MicrosoftTeams PowerShell module requires Windows PowerShell 5.1 or PowerShell 7.2 or later.
    Install Microsoft Teams PowerShell · Requirements, first paragraph · Checked 2026-09-25
  36. 37
    Remove-CsPhoneNumberAssignment can block a number from reassignment, indefinitely with -AssignmentBlockedForever or for 1 to 365 days with -AssignmentBlockedDays; both parameters were introduced in module 7.5.0.
    Remove-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -AssignmentBlockedDays and -AssignmentBlockedForever; Notes · Checked 2026-09-25
  37. 38
    From module 4.2.1-preview, Remove-CsPhoneNumberAssignment reports failures as exceptions appended to $Error and honours -ErrorAction, instead of returning a result object with Code and Message.
    Remove-CsPhoneNumberAssignment (MicrosoftTeams) · Description, Note paragraph · Checked 2026-09-25
  38. 39
    Unassigning a phone number with Remove-CsPhoneNumberAssignment automatically sets EnterpriseVoiceEnabled to False; the number stays in the tenant unless an assignment block is applied.
    Remove-CsPhoneNumberAssignment (MicrosoftTeams) · Description, first and second paragraphs · Checked 2026-09-25
  39. 40
    Remove-CsPhoneNumberAssignment -RemoveAll unassigns all phone numbers from a user or resource account without naming each number or its type.
    Remove-CsPhoneNumberAssignment (MicrosoftTeams) · Syntax, RemoveAll; Parameters, -RemoveAll; Example 2 · Checked 2026-09-25
  40. 41
    Microsoft's documented bulk pattern for number changes is a foreach loop over Get-CsPhoneNumberAssignment results that calls Set-CsPhoneNumberAssignment with -ErrorAction Stop inside Try/Catch for each number.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Examples 7 and 10 · Checked 2026-09-25
  41. 42
    Set-CsPhoneNumberAssignment -AssignmentCategory assigns a non-primary number: Private for an incoming-calls-only private line, or Alternate for an alternate line.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -AssignmentCategory; Examples 12 and 14 · Checked 2026-09-25
  42. 43
    Set-CsPhoneNumberAssignment is available only in the commercial, GCC, GCC High and DoD cloud instances.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Notes, second paragraph · Checked 2026-09-25
  43. 44
    Direct Routing numbers with extensions, in the form +1206555000;ext=1234 or 1206555000;ext=1234, can be assigned with Set-CsPhoneNumberAssignment.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -TelephoneNumber, second paragraph; Example 6 · Checked 2026-09-25
  44. 45
    To remove an emergency location from a phone number, pass the string 'null' to -LocationId; this is supported for Direct Routing numbers and for Operator Connect numbers not managed by the Service Desk.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -LocationId, second paragraph; Example 4 · Checked 2026-09-25
  45. 46
    In the Assignment parameter set, the Set-CsPhoneNumberAssignment reference describes -NetworkSiteId as the ID of a network site that represents a physical venue such as an office, a set of buildings or a campus.disputed
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, first -NetworkSiteId entry (Parameter sets: Assignment) · Checked 2026-09-25
  46. 47
    The second -NetworkSiteId entry in the Set-CsPhoneNumberAssignment reference, and the NetworkSiteId output in Get-CsPhoneNumberAssignment, say the parameter is reserved for internal Microsoft use.disputed
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, second -NetworkSiteId entry (Parameter sets: NetworkSiteUpdate, Assignment) · Checked 2026-09-25
  47. 48
    Set-CsPhoneNumberAssignment -TelephoneNumber accepts E.164 (+12065551234) and non-E.164 (12065551234) formats but not a tel: prefix.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -TelephoneNumber · Checked 2026-09-25
  48. 49
    In the Assignment parameter set of Set-CsPhoneNumberAssignment, -NumberType is mandatory and accepts DirectRouting, CallingPlan or OperatorConnect.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -NumberType · Checked 2026-09-25
  49. 50
    Set-CsPhoneNumberAssignment cannot set a number on an account whose phone number is set in on-premises Active Directory and synced to Microsoft 365; the number must first be cleared on premises and the change allowed to sync.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Notes, third paragraph · Checked 2026-09-25
  50. 51
    Set-CsPhoneNumberAssignment assigns a phone number to a user or resource account and automatically sets EnterpriseVoiceEnabled to True.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Description, first paragraph · Checked 2026-09-25
  51. 52
    Setting -ReverseNumberLookup SkipInternalVoip on a Direct Routing number makes internal calls to that number go out through external PSTN connectivity instead of internal VoIP via reverse number lookup.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Parameters, -ReverseNumberLookup; Example 11 · Checked 2026-09-25
  52. 53
    Set-CsPhoneNumberAssignment is available from module 3.0.0; the -Notify parameter was added in 7.3.0 and alternate number assignment in 7.6.0.
    Set-CsPhoneNumberAssignment (MicrosoftTeams) · Notes, first paragraph · Checked 2026-09-25
  53. 54
    Using Set-CsUser for Microsoft Teams users in commercial and GCC clouds is deprecated in favour of Set-CsPhoneNumberAssignment and Remove-CsPhoneNumberAssignment, including its -EnterpriseVoiceEnabled and -OnPremLineURI parameters.
    Set-CsUser (MicrosoftTeams) · Description, Note; Parameters, -EnterpriseVoiceEnabled and -OnPremLineURI notes · Checked 2026-09-25
  54. 55
    The Set-CsUser reference still documents -LineURI for assigning Direct Routing numbers to Teams users in GCC High and DoD, and says -OnPremLineURI is deprecated there in favour of -LineURI.
    Set-CsUser (MicrosoftTeams) · Parameters, -LineURI first paragraph; -OnPremLineURI second Note · Checked 2026-09-25
  55. 56
    Only Teams PowerShell Module versions in the 4.x.x series or later are supported; all earlier versions are fully retired.
    Teams PowerShell Module - Supported Versions · Opening paragraph · Checked 2026-09-25
  56. 57
    Test-CsEffectiveTenantDialPlan normalizes a dialed number using the normalization rules of a user's effective tenant dial plan, typically by piping Get-CsEffectiveTenantDialPlan -Identity <user> into it with -DialedNumber.
    Test-CsEffectiveTenantDialPlan (MicrosoftTeams) · Description; Examples 1 and 2 · Checked 2026-09-25
  57. 58
    Updating the module fails if it is already imported into the current PowerShell session; Microsoft says to close PowerShell and open a new elevated session first.
    Install Microsoft Teams PowerShell · Update Teams PowerShell Module, Warning box · Checked 2026-09-25
  58. 59
    The module should be updated with the same method used to install it; a module installed with Install-Module is updated with Update-Module MicrosoftTeams.
    Install Microsoft Teams PowerShell · Update Teams PowerShell Module · Checked 2026-09-25
  59. 60
    Module 8.0.0 has a breaking change that makes the RecordingEnabled, TranscriptionEnabled and AgentViewPermission parameters mandatory on New-CsAutoRecordingTemplate.
    PowerShell Gallery | MicrosoftTeams 8.0.0 · Release Notes block, [BREAKING CHANGE] line · Checked 2026-09-25

Documents

tier 2 current vendor documentation

Application-based authentication in Teams PowerShell Module

Microsoft · 2026-06-24 · accessed 2026-09-25

tier 2 current vendor documentation

Assign policies to users and groups

Microsoft · 2026-08-03 · accessed 2026-09-25

tier 2 current vendor documentation

Connect-MicrosoftTeams (MicrosoftTeams)

Microsoft · 2026-06-22 · accessed 2026-09-25

tier 2 current vendor documentation

Export-CsAcquiredPhoneNumber (MicrosoftTeams)

Microsoft · 2025-08-01 · accessed 2026-09-25

tier 2 current vendor documentation

Get-CsOnlineUser (MicrosoftTeams)

Microsoft · 2025-08-01 · accessed 2026-09-25

tier 2 current vendor documentation

Get-CsPhoneNumberAssignment (MicrosoftTeams)

Microsoft · 2026-08-07 · accessed 2026-09-25

tier 2 current vendor documentation

Grant-CsOnlineVoiceRoutingPolicy (MicrosoftTeams)

Microsoft · 2026-05-06 · accessed 2026-09-25

tier 2 current vendor documentation

Install Microsoft Teams PowerShell

Microsoft · 2026-02-20 · accessed 2026-09-25

tier 2 current vendor documentation

New-CsBatchPolicyAssignmentOperation (MicrosoftTeams)

Microsoft · 2025-08-01 · accessed 2026-09-25

tier 2 current vendor documentation

Remove-CsPhoneNumberAssignment (MicrosoftTeams)

Microsoft · 2026-08-07 · accessed 2026-09-25

tier 2 current vendor documentation

Set-CsPhoneNumberAssignment (MicrosoftTeams)

Microsoft · 2026-08-07 · accessed 2026-09-25

tier 2 current vendor documentation

Set-CsUser (MicrosoftTeams)

Microsoft · 2025-08-01 · accessed 2026-09-25

tier 2 current vendor documentation

Teams PowerShell Module - Supported Versions

Microsoft · 2026-02-25 · accessed 2026-09-25

tier 2 current vendor documentation

Test-CsEffectiveTenantDialPlan (MicrosoftTeams)

Microsoft · 2025-12-30 · accessed 2026-09-25

tier 3 vendor-maintained repositories

PowerShell Gallery | MicrosoftTeams

Microsoft (PowerShell Gallery) · 2026-09-15 · accessed 2026-09-25

tier 3 vendor-maintained repositories

PowerShell Gallery | MicrosoftTeams 8.0.0

Microsoft (PowerShell Gallery) · 2026-09-15 · accessed 2026-09-25

Cite this page

APA

WarmTransfer. (2026, September 25). Teams voice administration with PowerShell. WarmTransfer. https://warmtransfer.net/knowledge/teams-powershell-voice-admin

BibTeX

@misc{warmtransfer-teams-powershell-voice-admin,
  title  = {Teams voice administration with PowerShell},
  author = {{WarmTransfer}},
  year   = {2026},
  url    = {https://warmtransfer.net/knowledge/teams-powershell-voice-admin},
  note   = {Verified 2026-09-25}
}