3CX Teams integration

ravny

Customer
Joined
Nov 30, 2021
Messages
15
Reaction score
0
Hi,

I have issue when I run in power as shell admin !map_users.ps1" I get an error. What Im doing wrong ?


New-CsBatchPolicyAssignmentOperation : Invalid input parameters
At C:\Users\ravnikarm\Downloads\map_users.ps1:5 char:1
+ New-CsBatchPolicyAssignmentOperation -PolicyType TenantDialPlan -Poli ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ OperationName...tchAssignBody }:<>f__AnonymousType48`2) [New-CsBatchPoli...ion_NewExpanded], Exception
+ FullyQualifiedErrorId : ClientError,Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Cmdlets.NewCsBatchPolicyAssignmentOperation_NewExpanded
New-CsBatchPolicyAssignmentOperation : Invalid input parameters
At C:\Users\ravnikarm\Downloads\map_users.ps1:6 char:1
+ New-CsBatchPolicyAssignmentOperation -PolicyType OnlineVoiceRoutingPo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ OperationName...tchAssignBody }:<>f__AnonymousType48`2) [New-CsBatchPoli...ion_NewExpanded], Exception
+ FullyQualifiedErrorId : ClientError,Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Cmdlets.NewCsBatchPolicyAssignmentOperation_NewExpanded
New-CsBatchPolicyAssignmentOperation : Invalid input parameters
At C:\Users\ravnikarm\Downloads\map_users.ps1:7 char:1
+ New-CsBatchPolicyAssignmentOperation -PolicyType TeamsCallingPolicy - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ OperationName...tchAssignBody }:<>f__AnonymousType48`2) [New-CsBatchPoli...ion_NewExpanded], Exception
+ FullyQualifiedErrorId : ClientError,Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Cmdlets.NewCsBatchPolicyAssignmentOperation_NewExpanded

Thank you for answer
Matej
 
Hello @ravny ,

1. Can you please confirm that you executed the "teams_dial_plan.ps1" successfully with the same user that you are running "map_users.ps1"?

2. Did you tried to download once more the file "map_users.ps1" and execute it once more ?
 
Hi,

yes I execute with the same user as dail plan. Later I also try to execute once more dail plan but I get error messsage that alrady exist.
I also download once more not just twice but cupple of time and same error.

New-CsOnlinePSTNGateway : "OnlinePSTNGateway" with identity "teams.mycompany.com" already exists. To modify the existing item, use the Set- cmdlet. To create a new item, use a different identity

Thank you
Matej
 
Hi Matej,

In this section of the script, are there email address listed or are the parenthesis empty?
1638977214797.png
 
  • Like
Reactions: Evolute IT
Hi,

in the map users there are no email. This is what I have in map_users file

# Note: office phone number should start with a '+' and have from 2 to 15 digits
# If it's invalid please correct it in the Microsoft365 user settings

$users_ids = @()
New-CsBatchPolicyAssignmentOperation -PolicyType TenantDialPlan -PolicyName "3CX Dial Plan" -Identity $users_ids -OperationName "Batch assign dial plan"
New-CsBatchPolicyAssignmentOperation -PolicyType OnlineVoiceRoutingPolicy -PolicyName "3CX Voice Route Policy" -Identity $users_ids -OperationName "Batch assign voice routing"
New-CsBatchPolicyAssignmentOperation -PolicyType TeamsCallingPolicy -PolicyName "3CX Calling Policy" -Identity $users_ids -OperationName "Batch assign calling policy"

Brgds
 

Members Online Now

Forum statistics

Threads
111,831
Messages
589,277
Members
164,660
Latest member
RJenkinsROCK