Create an Auto Attendant

Requirements

Steps

General Info
  1. Log into the Teams Admin Portal
    • https://admin.teams.microsoft.com/
  2. Navigate to Voice > Auto Attendants
  3. Select + Add
  4. Enter in a Display name.
    • It’s recommended to start display names with either RAAA_ (Auto Attendant) to align with the resource accounts.
  5. Select an Operator if required.
    • (Operator will not be selected unless there is a receptionist at this location)
  6. Set the Time Zone and Language this Auto Attendant will use.
    • Make sure Enable Voice Inputs is not ticked unless needed.
  7. Select Next at the bottom of the page.
Call Flow
  1. Under First play a greeting message, select No greeting.
    • Avoid using a greeting in this section as it can cause issues if DTMF are recieved while playing this greeting.
  2. Under Then route the call and select Play menu options
  3. If you are using an audio file, click Upload file.
    • To use the Microsoft Voice, select Type in a greeting message and enter the script that will be said.
  4. Under Set menu options, click + Assign a dial key. There are 4 options to redirect the call on number press.
    • Operator Person in the organisation specified previously
    • Person in organisation A specific person in the organisation
    • Voice app Resource accounts (Call Queues, Auto Attendants, etc.)
    • Voicemail Desired Voicemail
  5. Turn off Dial by name under Directory Search
  6. Select Next at the bottom of the page.
    • You can jump to Resource Accounts at this point if you are not wanting to set Business Hours, Call Flows for After Hours, Call Flows during Holidays, and Dial Scopes
Call flow for after hours
  1. Set the business hours as required.
  2. If setting the after hours call flow, follow the steps above.
    • You can use an Audio File here before disconnecting/redirecting the call if desired.
  3. Select Next at the bottom of the page.
    • You can jump to Resource Accounts at this point if you are not wanting to set Call Flows during Holidays or Dial Scopes
Call flow for during Holidays
  1. To add a Holiday, click + Add.
  2. Enter a Holiday Name for the call setting.
  3. Select the Holiday from the drop down menu.
  4. Set the Greeting and Actions as per above.
  5. Select Save at the bottom of the page.
Dial Scope
  1. Select any user groups that are allowed to be searched for under Dial By Name
    • If turned off above, then this step won’t have an impact
Resource Accounts
  1. Select the Resource Account desired.
  2. Select Submit at the bottom of the page.

PowerShell

The script will prompt for a name to use for the new Auto Attendant and will auto-format the name as required

⚠ This script assumes you’ve already connected to the Skype for Business Online PowerShell Module. See Here to connect

#Get the name of the new Auto Attendant from the user
Write-Host "This script will create a new Resource Account and create the Auto Attendant" -BackgroundColor Yellow -ForegroundColor Black
Write-Host "The only allowed symbols are - and _"
$AaName = Read-Host "Please enter the name for the new Auto Attendant"

#Create the username for the Resource Account by removing all spaces and adding RAAA_ to the start
$AaDisplayName = $AaName -replace '[`~!@#$%^&\*()+={}|\[\]\;:\''",/<>?]',''
$RaAaUserName = $AaName -replace '\s','' -replace '[`~!@#$%^&\*()+={}|\[\]\;:\''",/<>?]',''
$RaAaUserName = "RAAA_$RaAaUserName{DOMAIN_NAME}"
$RaAaDisplayName = $AaName -replace '[`~!@#$%^&\*()+={}|\[\]\;:\''",/<>?]',''
$RaAaDisplayName = "RAAa_$RaAaDisplayName"

#Create a new Auto Attendant
New-CsOnlineApplicationInstance -UserPrincipalName $RaAaUserName -DisplayName $RaAaDisplayName -ApplicationId “ce933385-9390-45d1-9512-c8d228074e07”

Assign a PSTN phone number to the Resource Account

Raw PowerShell Code

$RaUPN = Read-Host "Please enter UPN for the Resource Account"
Write-Host "The PSTN number must be in E.164 format - IE: +61299995555" -BackgroundColor Yellow -ForegroundColor Black
$RaPSTN = Read-Host "Please enter PSTN number to assign to the Resource Account"

Set-CsOnlineApplicationInstance -Identity $RaUPN -OnpremPhoneNumber $RaPSTN

SBC-Easy PowerShell Code

The full script has now been included in the User Onboarding script here