Forum Discussion
danikoershuis
Jan 31, 2025Copper Contributor
I want to change auto aftandend number using powershell
Hello, i want to create a powershell script where i can change the Auto attendant of the teams admin so that users can change the phone number of the after hours without having a teams admin license...
- Feb 03, 2025
Hi danikoershuis,
You detached the Variables, so nothing is written back to the $AA VariableConnect-MicrosoftTeams #Get AutoAttendand $AA = Get-CsAutoAttendant -NameFilter AutoAttendantDemo01 $AA.CallFlows | where {$_.Name -eq "AutoAttendantDemo01 After hours call flow"} $Menu = ($aa.CallFlows | where {$_.Name -eq "AutoAttendantDemo01 After hours call flow"}).Menu $Menu.MenuOptions #Create a new Target $CallTarget = New-CsAutoAttendantCallableEntity -Identity "tel:+1234567890" -Type ExternalPSTN $menuOption = New-CsAutoAttendantMenuOption -Action TransferCallToTarget -DtmfResponse Automatic -CallTarget $CallTarget #Figure out witch is the After hours call flow -> In my case it's the first Entry in the Array [0] $aa.CallFlows[0] $aa.CallFlows[0].Menu.MenuOptions #Set ne new Menu Option with the new Target to the $AA Object $aa.CallFlows[0].Menu.MenuOptions = $menuOption #Update the Autoattendant Set-CsAutoAttendant -Instance $AA
Kind Regards
Andres
leonjackee6
Feb 01, 2025Copper Contributor
You can use the Set-Cs Auto Attendant cmdlet in PowerShell to modify the settings for the Auto Attendant, including the after-hours phone number. Just make sure to specify the correct Auto Attendant of and use the appropriate parameters for call routing options.
- danikoershuisFeb 04, 2025Copper Contributor
Hi Leonjackee6,
That is how far ive gotten before going on here the problem is i get into the auto attendent with cmdlet powershell but i cant change the number cause every command that i find or try its not availible. so if you have the correct one i would love to hear it.