Kaffeeundcode

Find TeamsCallQueuesWithoutAgents

Update: 14.04.2026

Skript Beschreibung

**Zusammenfassung**: Teams Call Queues Without Agents

Identifiziert Teams Call Queues Without Agents in der Teams-Telefonie.

Skript Infos

Autor Mattia Cirillo
Version 1.0
Sprache PowerShell
194_Find-TeamsCallQueuesWithoutAgents.ps1
<#
.SYNOPSIS
    Teams Call Queues Without Agents

.DESCRIPTION
    Identifiziert Teams Call Queues Without Agents in der Teams-Telefonie.

.NOTES
    File Name : 194_Find-TeamsCallQueuesWithoutAgents.ps1
    Author    : Kaffeeundcode
    Version   : 1.0
#>

param(
    [string]$OutputPath = "$PSScriptRoot/194_Find-TeamsCallQueuesWithoutAgents.csv",
    [int]$Top = 25,
    [switch]$SkipConnect
)

. "$PSScriptRoot/000_TeamsTelephonyHelper.ps1"

Ensure-TtCommand -Commands @("Get-CsCallQueue")
Initialize-TtSession -SkipConnect:$SkipConnect

$PropertyMap = ([ordered]@{
    Name = "Name"
    ResourceAccountCount = "ResourceAccounts.Count"
    AgentCount = "Agents.Count"
    DistributionListCount = "DistributionLists.Count"
    RoutingMethod = "RoutingMethod"
    PresenceBasedRouting = "PresenceBasedRouting"
    ConferenceMode = "ConferenceMode"
    LanguageId = "LanguageId"
})


$Items = @(Get-CsCallQueue)

$Items = Where-TtMissingValue -Items $Items -Path "Agents.Count"

$Result = Select-TtProps -Items $Items -PropertyMap $PropertyMap

$Result = @($Result | Sort-Object Name)

if ($OutputPath) {
    Export-TtData -Data $Result -OutputPath $OutputPath
    Write-Host "Export abgeschlossen: $OutputPath" -ForegroundColor Green
} else {
    Write-TtPreview -Data $Result -Top $Top
}