All scripts
Microsoft 365 749
Teams Voicemail Policy Report
Reports the Teams voicemail policy assigned to each user, flags anyone with voicemail disabled, and exports the results to CSV for a quick review during offboarding or a licensing check.
Get-TeamsVoicemailPolicyReport.ps1
<#
.SYNOPSIS
Reports the Teams voicemail policy assigned to each user and flags anyone with voicemail disabled.
.DESCRIPTION
Connects to Microsoft Teams PowerShell, pulls every enabled user with a Teams voicemail policy assignment, and builds a report showing the policy name, whether voicemail is enabled, and whether transcription is turned on. Useful for a quick audit before a licensing review or when tracking down why a specific user isn't getting missed call voicemails.
.AUTHOR
Shehryar Hassan
.EXAMPLE
.\Get-TeamsVoicemailPolicyReport.ps1 -OutputPath C:\Reports\VoicemailPolicy.csv
Connects to Teams, builds the report for every enabled user, and saves it to the given path.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[string]$OutputPath = ".\TeamsVoicemailPolicyReport.csv"
)
if (-not (Get-Module -ListAvailable -Name MicrosoftTeams)) {
Write-Error "The MicrosoftTeams module isn't installed. Run: Install-Module MicrosoftTeams -Scope CurrentUser"
return
}
Import-Module MicrosoftTeams -ErrorAction Stop
try {
Connect-MicrosoftTeams -ErrorAction Stop | Out-Null
}
catch {
Write-Error "Could not connect to Microsoft Teams: $($_.Exception.Message)"
return
}
Write-Host "Pulling Teams users, this can take a minute on larger tenants..."
$users = Get-CsOnlineUser -Filter { Enabled -eq $true } -ErrorAction Stop
$report = foreach ($user in $users) {
$voicemailSettings = $null
try {
$voicemailSettings = Get-CsOnlineVoicemailUserSettings -Identity $user.Identity -ErrorAction Stop
}
catch {
Write-Verbose "Could not read voicemail settings for $($user.UserPrincipalName): $($_.Exception.Message)"
}
[PSCustomObject]@{
DisplayName = $user.DisplayName
UserPrincipalName = $user.UserPrincipalName
VoicemailPolicy = $user.OnlineVoicemailPolicy
VoicemailEnabled = if ($voicemailSettings) { -not $voicemailSettings.VoicemailIsDisabled } else { "Unknown" }
TranscriptionOn = if ($voicemailSettings) { $voicemailSettings.TranscriptionEnabled } else { "Unknown" }
PromptLanguage = if ($voicemailSettings) { $voicemailSettings.PromptLanguage } else { "Unknown" }
}
}
$report | Sort-Object DisplayName | Export-Csv -Path $OutputPath -NoTypeInformation
$disabledCount = ($report | Where-Object { $_.VoicemailEnabled -eq $false }).Count
Write-Host "Report saved to $OutputPath"
Write-Host "$($report.Count) users checked, $disabledCount have voicemail disabled."
Read it before you run it, and test in a safe tenant first.