Jump to content

Group Number Replacement Powershell command


ReGott
 Share


Recommended Posts

Hello, we moved our phone server and want to import the data. When we tried to import, we recognized that there is no option in this command to assign the numbers to specific trunks.

 

My command:

foreach ($EntryId in import-csv Path/to/csv) { New-IpPbxTrunkGroupNumberReplacement -Number "$($EntryId.Number)" -Replacement "$($EntryId.Replacement)" -ReplacementType "$($EntryId.ReplacementType )" -PartyType "$($EntryId.PartyType )"}

 

At first, I want to know whether it works like this.

And how is it possible to tell them which trunk they should go in?

 

If more information is needed, write me.
Thanks for your help
Greetings

Link to comment
Share on other sites


  • Most Valued User

Hi ReGott,

 

the "New-IpPbx*" commandlets only create new objects. You still have to add them to the SwyxWare with a corresponding "Add-IpPbx*" commandlet. In your case like this (UNTESTED):

 

Import-Csv "C:\Test.csv" | ForEach-Object {

    $currentEntry = $_

    # Create new trunk group number replacement object with the imported data
    $newReplEntry = New-IpPbxTrunkGroupNumberReplacement -Number $currentEntry.Number -Replacement $currentEntry.Replacement -ReplacementType $currentEntry.ReplacementType -PartyType $currentEntry.PartyType
    
    # Add the new object to the trunk with the name "MyTrunk"
    Add-IpPbxTrunkGroupNumberReplacement -NumberReplacementEntry $newReplEntry -TrunkGroupName "MyTrunk"
}

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • 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.