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...
- Nov 26, 2025
Hello @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 $contentWith:
$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.
JFM_12
Dec 01, 2025Iron Contributor
Hello Nivedipa-MSFT
Thank you very much. It worked
Regards
Juan
Nivedipa-MSFT
Microsoft
Dec 01, 2025@JFM_12 - I'm glad to hear the issue has been resolved. When you have a moment, could you please share your feedback?
Your feedback is important to us. Please rate us:
🤩 Excellent 🙂 Good 😐 Average 🙁 Needs Improvement 😠 Poor