Jump to content

Setting Alternative Numbers With Ps


CerielRoland

Recommended Posts

  • 4 weeks later...
  • Most Valued User

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 -WhatIf


This 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 $u

After 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


  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.