|
| 1 | +--- |
| 2 | +external help file: Microsoft.Open.Teams.CommonLibrary.dll-Help.xml |
| 3 | +Module Name: MicrosoftTeams |
| 4 | +online version: https://docs.microsoft.com/powershell/module/teams/set-csphonenumberassignment |
| 5 | +applicable: Microsoft Teams |
| 6 | +author: jenstrier |
| 7 | +ms.author: jenstr |
| 8 | +ms.reviewer: |
| 9 | +manager: |
| 10 | +schema: 2.0.0 |
| 11 | +--- |
| 12 | + |
| 13 | +# Set-CsPhoneNumberAssignment |
| 14 | + |
| 15 | +## SYNOPSIS |
| 16 | +This cmdlet will assign a phone number to a user or a resource account (online application instance). |
| 17 | + |
| 18 | +> [!NOTE] |
| 19 | +> **Preview** The use of this cmdlet is in Public Preview. |
| 20 | + |
| 21 | +## SYNTAX |
| 22 | + |
| 23 | +```powershell |
| 24 | +Set-CsPhoneNumberAssignment [[-Identity] <String> [-PhoneNumber <String>] [-PhoneNumberType <String>] [-LocationId <String>] [-EnterpriseVoiceEnabled <Boolean>][<CommonParameters>] |
| 25 | +
|
| 26 | +``` |
| 27 | + |
| 28 | +## DESCRIPTION |
| 29 | +This cmdlet assigns a phone number to a user or resource account. |
| 30 | + |
| 31 | +## EXAMPLES |
| 32 | + |
| 33 | +### Example 1 |
| 34 | +```powershell |
| 35 | +Set-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -PhoneNumberType CallingPlan |
| 36 | +``` |
| 37 | +This example assigns the Microsoft Calling Plan phone number +1 (206) 555-1234 to the user user1@contoso.com. |
| 38 | + |
| 39 | +### Example 2 |
| 40 | +```powershell |
| 41 | +$loc=Get-CsOnlineLisLocation -City Vancouver |
| 42 | +Set-CsPhoneNumberAssignment -Identity user2@contoso.com -PhoneNumber +12065551224 -PhoneNumberType CallingPlan -LocationId $loc.LocationId |
| 43 | +``` |
| 44 | +This example finds the emergency location defined for the corporate location Vancouver and assigns the Microsoft Calling Plan phone number +1 (206) 555-1224 and location |
| 45 | +to the user user2@contoso.com. |
| 46 | + |
| 47 | +### Example 3 |
| 48 | +```powershell |
| 49 | +Set-CsPhoneNumberAssignment -Identity user3@contoso.com -EnterpriseVoiceEnabled $true |
| 50 | +``` |
| 51 | +This example sets the EnterpriseVoiceEnabled flag on the user user2@contoso.com. |
| 52 | + |
| 53 | + |
| 54 | +## PARAMETERS |
| 55 | + |
| 56 | +### -EnterpriseVoiceEnabled |
| 57 | +Flag indicating if the user or resource account should be EnterpriseVoiceEnabled. |
| 58 | + |
| 59 | +This parameter is mutual exclusive with PhoneNumber. |
| 60 | + |
| 61 | +```yaml |
| 62 | +Type: System.Boolean |
| 63 | +Parameter Sets: (All) |
| 64 | +Aliases: |
| 65 | +Applicable: Microsoft Teams |
| 66 | + |
| 67 | +Required: False |
| 68 | +Default value: None |
| 69 | +Accept pipeline input: False |
| 70 | +Accept wildcard characters: False |
| 71 | +``` |
| 72 | +
|
| 73 | +### -Identity |
| 74 | +The Id of the specific user or resource account. Can be specified using the ObjectId, the SIP address or the e-mail address. |
| 75 | +
|
| 76 | +```yaml |
| 77 | +Type: System.String |
| 78 | +Parameter Sets: (All) |
| 79 | +Aliases: |
| 80 | + |
| 81 | +Required: True |
| 82 | +Default value: None |
| 83 | +Accept pipeline input: False |
| 84 | +Accept wildcard characters: False |
| 85 | +``` |
| 86 | +
|
| 87 | +### -LocationId |
| 88 | +The Id of the location to assign to the specific user. You can get it using Get-CsOnlineLisLocation |
| 89 | +
|
| 90 | +```yaml |
| 91 | +Type: System.String |
| 92 | +Parameter Sets: (All) |
| 93 | +Aliases: |
| 94 | + |
| 95 | +Required: False |
| 96 | +Default value: None |
| 97 | +Accept pipeline input: False |
| 98 | +Accept wildcard characters: False |
| 99 | +``` |
| 100 | +
|
| 101 | +### -PhoneNumber |
| 102 | +The phone number to assign to the user or resource account. Supports E.164 format like +12065551234 and non-E.164 format like 12065551234. We are not currently supporting |
| 103 | +Direct Routing numbers with extensions, but you can use the Set-CsUser cmdlet for this. |
| 104 | +
|
| 105 | +Setting a phone number will automatically set EnterpriseVoiceEnabled to True. |
| 106 | +
|
| 107 | +```yaml |
| 108 | +Type: System.String |
| 109 | +Parameter Sets: (All) |
| 110 | +Aliases: |
| 111 | + |
| 112 | +Required: False |
| 113 | +Default value: None |
| 114 | +Accept pipeline input: False |
| 115 | +Accept wildcard characters: False |
| 116 | +``` |
| 117 | +
|
| 118 | +### -PhoneNumberType |
| 119 | +The type of phone number to assign to the user or resource account. The supported values are DirectRouting, CallingPlan and OperatorConnect. |
| 120 | +
|
| 121 | +```yaml |
| 122 | +Type: System.String |
| 123 | +Parameter Sets: (All) |
| 124 | +Aliases: |
| 125 | + |
| 126 | +Required: False |
| 127 | +Default value: None |
| 128 | +Accept pipeline input: False |
| 129 | +Accept wildcard characters: False |
| 130 | +``` |
| 131 | +
|
| 132 | +### CommonParameters |
| 133 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). |
| 134 | +
|
| 135 | +## INPUTS |
| 136 | +
|
| 137 | +### None |
| 138 | +
|
| 139 | +## OUTPUTS |
| 140 | +
|
| 141 | +### System.Object |
| 142 | +
|
| 143 | +## NOTES |
| 144 | +The cmdlet is available in Teams PS module 2.6.1-preview or later. |
| 145 | +
|
| 146 | +## RELATED LINKS |
| 147 | +- [Remove-CsPhoneNumberAssignment](Remove-CsPhoneNumberAssignment.md) |
0 commit comments