SOLVED

Updating an existing Auto Attendant

Copper 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
$GreetingAudioFile
$WelcomePrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $GreetingAudioFile
Set-CsAutoAttendant -Identity "$AutoAttendant"

 

 

 

 

I typically get this kind of response:

davidashworth_0-1655705111662.png

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?

 

Thanks,
David

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
https://robdy.io/manage-auto-attendant-general/

and also see here

https://docs.microsoft.com/en-us/powershell/module/skype/new-csautoattendantprompt?view=skype-ps

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

davidashworth_0-1655764285877.png

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

davidashworth_1-1655764353973.png

i get a different error if i use identity

davidashworth_2-1655764377781.png

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?

 

Thanks,
David

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

davidashworth_0-1655769457443.png

but no changes are made to the greeting

davidashworth_1-1655769494981.png

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

 

best response confirmed by davidashworth (Copper Contributor)
Solution

@davidashworth 

 

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

$aa.DefaultCallFlow.Greetings=$greetingPrompt


# save the config
Set-CsAutoAttendant -Instance $aa

 

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

 

s

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

$aa.DefaultCallFlow.Greetings=$greetingPrompt
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?
Thanks,
David
1 best response

Accepted Solutions
best response confirmed by davidashworth (Copper Contributor)
Solution

@davidashworth 

 

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

$aa.DefaultCallFlow.Greetings=$greetingPrompt


# save the config
Set-CsAutoAttendant -Instance $aa

 

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

 

s

View solution in original post