ReGott Posted June 19, 2023 #1 Share Posted June 19, 2023 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 More sharing options...
Most Valued User Sebastian Dreier Posted June 19, 2023 Most Valued User #2 Share Posted June 19, 2023 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 More sharing options...
ReGott Posted June 21, 2023 Author #3 Share Posted June 21, 2023 Thank you Sebastian Dreier for your quic response. I try it soon and give you feedback. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now