Created
June 5, 2020 05:49
-
-
Save Atreidae/addb33e0de03f4dc2a610cac83444fce to your computer and use it in GitHub Desktop.
A quick script to export all the custom UM Prompts from Microsoft Exchange
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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