Kaffeeundcode

Find TeamsVoiceEnabledUsersWithoutDialPlan

Update: 14.04.2026

Skript Beschreibung

**Zusammenfassung**: Teams Voice Enabled Users Without Dial Plan

Identifiziert Teams Voice Enabled Users Without Dial Plan in der Teams-Telefonie.

Skript Infos

Autor Mattia Cirillo
Version 1.0
Sprache PowerShell
334_Find-TeamsVoiceEnabledUsersWithoutDialPlan.ps1
<#
.SYNOPSIS
    Teams Voice Enabled Users Without Dial Plan

.DESCRIPTION
    Identifiziert Teams Voice Enabled Users Without Dial Plan in der Teams-Telefonie.

.NOTES
    File Name : 334_Find-TeamsVoiceEnabledUsersWithoutDialPlan.ps1
    Author    : Kaffeeundcode
    Version   : 1.0
#>

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

. "$PSScriptRoot/000_TeamsTelephonyHelper.ps1"

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

$PropertyMap = ([ordered]@{
    DisplayName = "DisplayName"
    UserPrincipalName = "UserPrincipalName"
    LineURI = "LineURI"
    OnPremLineURI = "OnPremLineURI"
    EnterpriseVoiceEnabled = "EnterpriseVoiceEnabled"
    HostedVoiceMail = "HostedVoiceMail"
    UsageLocation = "UsageLocation"
    Department = "Department"
    Office = "Office"
    City = "City"
    Country = "Country"
})


$Items = @(Get-CsOnlineUser -ResultSize Unlimited)

$Items = $Items | Where-Object { [bool](Get-TtProp -InputObject $_ -Path "EnterpriseVoiceEnabled") -and -not (Get-TtProp -InputObject $_ -Path "TenantDialPlan") }

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

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

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