- Joined
- Jan 17, 2023
- Messages
- 26
- Reaction score
- 7
the powershell user script sets three Teams Policies in batch.
I executed it and after some troubleshooting I found out that all policy sets are failing with "notfound"
I did it step by step for troubleshooting - I even tried with the GUID of the user just in case there was something screwy going on with the email address
(hid the ID for privacy reason)
$users_ids = @("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
New-CsBatchPolicyAssignmentOperation -PolicyType TenantDialPlan -PolicyName "3CX Dial Plan" -Identity $users_ids -OperationName "Batch assign dial plan"
c8f857a5-9948-4a59-8d81-0ba7d954d866
get-csbatchpolicyassignmentoperation -OperationId c8f857a5-9948-4a59-8d81-0ba7d954d866
OperationId OperationName OverallStatus CreatedBy CreatedTime CompletedTime CompletedCount ErrorCou
nt
----------- ------------- ------------- --------- ----------- ------------- -------------- --------
c8f857a5-9948-4a59-8d81-0ba7d954d866 Batch assign dial plan InProgress XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 6/27/2025 7:04:03 PM 0 0
get-csbatchpolicyassignmentoperation
OperationId OperationName OverallStatus CreatedBy CreatedTime CompletedTime CompletedCount ErrorCount
----------- ------------- ------------- --------- ----------- ------------- -------------- ----------
c8f857a5-9948-4a59-8d81-0ba7d954d866 Batch assign dial plan CompletedWithErrors XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 6/27/2025 7:04:03 PM 6/27/2025 7:08:09 PM 0 1
get-csbatchpolicyassignmentoperation -OperationId c8f857a5-9948-4a59-8d81-0ba7d954d866 | Select -ExpandProperty Userstate
Id Result State
-- ------ -----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX NotFound CompletedWithErrors
After this failed various times I went into the MS Teams Admin site and set the Policy manually on the user which then resulted that the integration was fully working.
This is a good workaround for a few users but not for many. So I am not sure why the PS script has this issue but manual assigining of the Policy works.
I executed it and after some troubleshooting I found out that all policy sets are failing with "notfound"
I did it step by step for troubleshooting - I even tried with the GUID of the user just in case there was something screwy going on with the email address
(hid the ID for privacy reason)
$users_ids = @("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
New-CsBatchPolicyAssignmentOperation -PolicyType TenantDialPlan -PolicyName "3CX Dial Plan" -Identity $users_ids -OperationName "Batch assign dial plan"
c8f857a5-9948-4a59-8d81-0ba7d954d866
get-csbatchpolicyassignmentoperation -OperationId c8f857a5-9948-4a59-8d81-0ba7d954d866
OperationId OperationName OverallStatus CreatedBy CreatedTime CompletedTime CompletedCount ErrorCou
nt
----------- ------------- ------------- --------- ----------- ------------- -------------- --------
c8f857a5-9948-4a59-8d81-0ba7d954d866 Batch assign dial plan InProgress XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 6/27/2025 7:04:03 PM 0 0
get-csbatchpolicyassignmentoperation
OperationId OperationName OverallStatus CreatedBy CreatedTime CompletedTime CompletedCount ErrorCount
----------- ------------- ------------- --------- ----------- ------------- -------------- ----------
c8f857a5-9948-4a59-8d81-0ba7d954d866 Batch assign dial plan CompletedWithErrors XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 6/27/2025 7:04:03 PM 6/27/2025 7:08:09 PM 0 1
get-csbatchpolicyassignmentoperation -OperationId c8f857a5-9948-4a59-8d81-0ba7d954d866 | Select -ExpandProperty Userstate
Id Result State
-- ------ -----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX NotFound CompletedWithErrors
After this failed various times I went into the MS Teams Admin site and set the Policy manually on the user which then resulted that the integration was fully working.
This is a good workaround for a few users but not for many. So I am not sure why the PS script has this issue but manual assigining of the Policy works.