Forum Discussion
JFM_12
Nov 25, 2025Iron Contributor
Powershell adding a existing holiday to Auto Attendant
Hello I have to add an existing Holiday to Auto Attendant and have this script # Connect to Microsoft Teams
# Connect-MicrosoftTeams
# Variables - Replace with your actual values
$autoAttendantN...
Nivedipa-MSFT
Microsoft
Nov 26, 2025Hello @JFM_12 - Thanks for bringing this issue to our attention.
The error occurs because Import-CsOnlineAudioFile expects the -Content parameter as a byte array, but the way you're passing it may not be compatible with the cmdlet's internal processing.
Fix:
Replace this line:
$content = [System.IO.File]::ReadAllBytes('Path\test.wav')
$audioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "test.wav" -Content $content
With:
$audioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "test.wav" -Content ([System.IO.File]::ReadAllBytes('Path\test.wav'))
Please let us know if you have any further query.