Updating an existing Auto Attendant

Occasional Contributor

Hi all,


I have been looking and cant find specific help on this subject. Ive seen loads of posts to create new AA's but not really to change an existing one. The scenario is that i want to update the greeting which will be customer facing via a power app. I would be using PowerShell in the backend and this is the code i have so far:





$AutoAttendantID = "1b87d836-ba69-4da5-a6ef-c3874b28353d"
$AutoAttendant = Get-CsAutoAttendant -Identity "$AutoAttendantID"
$content = Get-Content "C:\temp\voice.wav" -Encoding byte -ReadCount 0
$GreetingAudioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "voice.wav" -Content $content
$WelcomePrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $GreetingAudioFile
Set-CsAutoAttendant -Identity "$AutoAttendant"





I typically get this kind of response:


But no changes are made to the actual AA. Am i doing something wrong or is what im trying to do not yet supported?


Will it be simpler for my script to delete the existing AA and then create a new one?



9 Replies
Hello David,

Set-CsAutoAttendant has no -Identity parameter, but -Instance was maybe that a typo? Be sure to be running the latest stable version of the module (4.4.1)

In your example, you are not updating the AA object with the new prompt

Please see here as an example of modifying an AA

and also see here

Hi @Andres Gorzelany ,


Thanks for your reply. I had come across both of those articles yesterday so i have adjusted my script but its still not working. First i am running the required version


I have then adjusted my script to the following:

# get the AA details
$attendantName = 'CRED POC AA'
$aa = Get-CsAutoAttendant -NameFilter $attendantName | Where-Object Name -eq $attendantName
# upload audio file
$content = Get-Content "C:\Temp\Voice.wav" -Encoding byte -ReadCount 0
$AudioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "Voice.Wav" -Content $content
$AudioFilePrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $audioFile
# save the config
Set-CsAutoAttendant -Instance $aa

but i get an error


i get a different error if i use identity


i have gone through it and cant see any typo's and i think the code is written correctly as per those articles but it still looks like i have something wrong?



I don't understand why Instance is not being recognized for you as a parameter, what permissions do you have in the tenant?

Hi @Andres Gorzelany, i am using an account with the Global Admin role

@Andres Gorzelany 


So I closed and re-opened PS and now I'm not getting any errors


but no changes are made to the greeting


i would have imagined that it would show something like "voice.wav"


best response confirmed by davidashworth (Occasional Contributor)



This is a quick example i made, 


$attendantName = 'AA_BV_01'
$aa = Get-CsAutoAttendant -NameFilter $attendantName | Where-Object Name -eq $attendantName

$content = Get-Content "C:\Message.wav" -Encoding byte -ReadCount 0
$audioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "Message.wav" -Content $content

$greetingPrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $audioFile


# save the config
Set-CsAutoAttendant -Instance $aa


The key is to save the changes to the $aa object



thank you - that works perfectly. I was missing the part

Glad to hear!
Hi Andres,

Have you ever tried to update the audio for an auto attendant using flow and either a form or power app? Seems there is a trick to passing the audio file from the form\app to the runbook. Ive tried various suggestions from other forums but not really getting anywhere. Or perhaps you know of a forum i can have a look at?