Oct 24 2023 02:08 AM
Hello
Do you have a script that gives me the name of the CallQueue and the call answering method
- Team
- Chose users and groups
What I would also need the name of Team or "Chose users and groups"
Do you have such a script
Thank you very much
JFM_12
Oct 24 2023 07:12 AM
Hi @JFM_12,
here is an example code you could use:
# Import the Microsoft Teams PowerShell module
Import-Module MicrosoftTeams
# Get a list of all Call Queues
$callQueues = Get-CsCallQueue -Filter *
# Iterate through each Call Queue
foreach ($cq in $callQueues) {
Write-Host "Call Queue Name: $($cq.DisplayName)"
# Get Call Answering Method
$answeringMethod = Get-CsCallQueueInfo -Identity $cq.Identity
Write-Host "Call Answering Method: $($answeringMethod.CallAnsweringMethod)"
# Check if the answering method is 'Team'
if ($answeringMethod.CallAnsweringMethod -eq "Team") {
$team = Get-CsTeam -GroupId $cq.GroupId
Write-Host "Team Name: $($teamName)"
} else {
# Get the users and groups if not using 'Team'
$usersGroups = Get-CsCallQueueAgent -Identity $cq.Identity
Write-Host "Users/Groups:"
foreach ($userGroup in $usersGroups) {
Write-Host " - $($userGroup.AgentId)"
}
}
Write-Host "--------------------------------------"
}
# Disconnect from Microsoft Teams
Disconnect-MicrosoftTeams
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)
Oct 24 2023 08:23 AM
Oct 25 2023 06:00 AM - edited Oct 25 2023 06:02 AM
Hello
I tried to run the script but the terms "Get-CsCallQueueAgent" and "Get-CsCallQueueInfo" do not exist according to the output
Thank you for your reply
JFM_12