Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A quick script to export all the custom UM Prompts from Microsoft Exchange
$AutoAttendants = (get-UmAutoAttendant)
Foreach ($Attendant in $AutoAttendants)
{
Write-host "Processing $($attendant.name)" -colour green
New-Item -Path . -Name $attendant.name -ItemType "directory"
Set-Location -Path .\$($Attendant.name)
#Info
If ($attendant.InfoAnnouncementFilename -eq "")
{
Write-host "No Info Announcement, Skipping"
}
Else
{
Write-host "Exporting Info Announcement"
$prompt = Export-UMPrompt -UMAutoAttendant $attendant.name -PromptFileName $attendant.InfoAnnouncementFilename
Set-Content -Path ".\InfoAnnouncement.mp3" -Value $prompt.AudioData -Encoding Byte
}
#Bh Welcome
If ($attendant.BusinessHoursWelcomeGreetingFilename -eq "")
{
Write-host "No BH Welcome Announcement, Skipping"
}
Else
{
Write-host "Exporting BH Welcome Announcement"
$prompt = Export-UMPrompt -UMAutoAttendant $attendant.name -PromptFileName $attendant.BusinessHoursWelcomeGreetingFilename
Set-Content -Path ".\BusinessHoursWelcomeGreeting.mp3" -Value $prompt.AudioData -Encoding Byte
}
#BH Menu
If ($attendant.BusinessHoursMainMenuCustomPromptFilename -eq "")
{
Write-host "No BH Main Menu Announcement, Skipping"
}
Else
{
Write-host "Exporting BH Main Menu Announcement"
$prompt = Export-UMPrompt -UMAutoAttendant $attendant.name -PromptFileName $attendant.BusinessHoursMainMenuCustomPromptFilename
Set-Content -Path ".\BusinessHoursMainMenuCustomPrompt.mp3" -Value $prompt.AudioData -Encoding Byte
}
#AH Welcome
If ($attendant.AfterHoursWelcomeGreetingFilename -eq "")
{
Write-host "No AH Welcome Announcement, Skipping"
}
Else
{
Write-host "Exporting AH Welcome Announcement"
$prompt = Export-UMPrompt -UMAutoAttendant $attendant.name -PromptFileName $attendant.AfterHoursWelcomeGreetingFilename
Set-Content -Path ".\AfterHoursWelcomeGreeting.mp3" -Value $prompt.AudioData -Encoding Byte
}
#AH Main Menu
If ($attendant.AfterHoursMainMenuCustomPromptFilename -eq "")
{
Write-host "No AH Main Menu Announcement, Skipping"
}
Else
{
Write-host "Exporting AH Main Menu Announcement"
$prompt = Export-UMPrompt -UMAutoAttendant $attendant.name -PromptFileName $attendant.AfterHoursMainMenuCustomPromptFilename
Set-Content -Path ".\AfterHoursMainMenuCustomPrompt.mp3" -Value $prompt.AudioData -Encoding Byte
}
Set-Location -Path ..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.