Forum Discussion

JFM_12's avatar
JFM_12
Iron Contributor
Apr 02, 2026
Solved

Get all AA/CQ with Resource Accounts

Hello Is it possible to have a script that pulls out all AA/CQ with resource accounts. I would like to pull it to find out which of the AA/CQ do not have resource account. If there is no resource ...
  • Sayali-MSFT's avatar
    Sayali-MSFT
    Apr 07, 2026

    Hello JFM_12,
    The supported approach is to query AAs and CQs separately and then join them with resource accounts via application instance associations.

    At a high level, the process is:

    1. Use Get-CsAutoAttendant and Get-CsCallQueue to retrieve all AAs and CQs.
    2. Use Get-CsOnlineApplicationInstance to retrieve all resource accounts.
    3. For each AA and CQ, check whether a resource account is associated by matching the ConfigurationId using Get-CsOnlineApplicationInstanceAssociation.
    4. If no associated resource account is found, treat that entry as missing a resource account.

    Microsoft documents that each Auto Attendant or Call Queue is expected to have a resource account, but the platform does allow misconfigured or orphaned objects to exist (for example, after deletions or failed provisioning), which is why this audit is useful.

    As reference:

    • Resource accounts are required and managed separately:
      https://learn.microsoft.com/en-us/microsoftteams/manage-resource-accounts
    • Associations between resource accounts and AAs/CQs are handled via Online Application Instance associations:
      https://learn.microsoft.com/en-us/powershell/module/skype/new-csonlineapplicationinstanceassociation

    If you want to avoid writing custom logic from scratch, community tools such as TeamsAACQTools already implement this correlation logic and can export AA/CQ configurations alongside their resource accounts:

    • https://github.com/ashhw/TeamsAACQTools