CerielRoland Posted April 2, 2015 #1 Share Posted April 2, 2015 Hi there, Is it possible to set a alternative number via Powershell?I need to set the outgoing number for all my users and have managed to do it AFTER the alternative number has been added to all the users. Thanks! Link to comment Share on other sites More sharing options...
Most Valued User Martin Posted April 25, 2015 Most Valued User #2 Share Posted April 25, 2015 There is not easy to use cmdlet in the SwyxWare PowerShell module for that. But you can do that anyway. Here's the short version: Get-IpPbxUser -UserName "User 1" | ForEach-Object { $a = new-object "SWConfigDataClientLib.Proxies.Users.SubstitutedNumberEntry" $a.InternalNumberID = (Get-IpPbxInternalNumber -InternalNumber "4711") | Select -ExpandProperty InternalNumberID) $_.SubstitutedNumberEntryCollection.Add($a) $_ } | Update-IpPbxUser -WhatIfThis adds alternative number 4711 to "User 1". As you can see an alternative number has to be an actual internal number of another user. To make it a little easier to understand here is a longer version: # Get the alternative number ID $InternalNumber = Get-IpPbxInternalNumber -InternalNumber "4711" $AlternativeNumberID = $InternalNumber.InternalNumberID # Get the user who will get the alternative number $u = Get-IpPbxUser -UserName "User 1" # create an Alternative number object $a = new-object "SWConfigDataClientLib.Proxies.Users.SubstitutedNumberEntry" $a.InternalNumberID = $AlternativeNumberID # add the alternative number to the user $u.SubstitutedNumberEntryCollection.Add($a) # update the user Update-IpPbxUser -UserEntry $uAfter configuring the alternative number the user can select it in the line configuration in SwyxIt!. In case you want to script configuring the SwyxIt! line configuration you can do that as well. Here's an example to configure the user's first line to use the alternative number for outgoing calls (Assuming you already got the user object in $u via get-ippbxuser): $ud = Get-IpPbxUserData -UserEntry $u $ud.m_LineKeySettings[0].ExtensionOutGoing = "4711" Set-IpPbxUserData -UserEntry $u -UserData $ud Link to comment Share on other sites More sharing options...
CerielRoland Posted May 27, 2015 Author #3 Share Posted May 27, 2015 Wow, sorry for the late reply, thanks Martin !! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.