Forum Discussion

JFM_12's avatar
JFM_12
Iron Contributor
Nov 25, 2025
Solved

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's avatar
    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 $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.

Resources