none
Add Resource Account to Call Queue in Teams using Powershell RRS feed

  • Question

  • I can create a Resource Account and a Call Queue using Powershell, but I don't see how to add that account to the Call Queue using Powershell.

    Is this possible?


    Simon

    Monday, December 2, 2019 2:06 PM

Answers

  • In order to make this work, it is first necessary to assign a UsageLocation to the Msol User of the application instance.  

    # create application instance
    New-CsOnlineApplicationInstance -UserPrincipalName testra1@contoso.com -ApplicationId “11cd3e2e-fccb-42ad-ad00-878b93575e07” -DisplayName "Resource account 1"
    
    # set location
    Set-MsolUser -UserPrincipalName "testra1@contoso.com" -UsageLocation US
    
    # add virtual license
    Set-MsolUserLicense -UserPrincipalName testra1@contoso.com -AddLicenses "contosocom:PHONESYSTEM_VIRTUALUSER"
    
    #Set phone number
    Set-CsOnlineVoiceApplicationInstance -Identity "testra1@contoso.com" -TelephoneNumber "12125551234"
    
    #build list of userIds to add to the call queue
    $userIds = get-msoluser | Where-Object {$_.UserPrincipalName -in @("user1@contoso.com", "user2@contoso.com")} | Select -Expand ObjectId
    
    # Create call queue and add users
    New-CsCallQueue -Name testCQ1 -Users $userIds 
    
    #get application id and call queue id
    $applicationInstanceId = (Get-CsOnlineUser "testra1@contoso.com")[-1].ObjectId
    $callQueueId = (Get-CsCallQueue -NameFilter "testCQ1").Identity
    
    #make the connection
    New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceId) -ConfigurationId $callQueueId -ConfigurationType CallQueue


    Simon

    Wednesday, December 25, 2019 9:52 AM
  • Here I will provide a brief summary of this post. This will make answer searching easier in the forum .

     

    <Request/Expectation>:

    I can create a Resource Account and a Call Queue using PowerShell, but I don't see how to add that account to the Call Queue using PowerShell.

     

    <Suggestions>:

    In order to make this work, it is first necessary to assign a UsageLocation to the Msol User of the application instance.

    # create application instance
    New-CsOnlineApplicationInstance -UserPrincipalName testra1@contoso.com -ApplicationId “11cd3e2e-fccb-42ad-ad00-878b93575e07” -DisplayName "Resource account 1"
    
    # set location
    Set-MsolUser -UserPrincipalName "testra1@contoso.com" -UsageLocation US
    
    # add virtual license
    Set-MsolUserLicense -UserPrincipalName testra1@contoso.com -AddLicenses "contosocom:PHONESYSTEM_VIRTUALUSER"
    
    #Set phone number
    Set-CsOnlineVoiceApplicationInstance -Identity "testra1@contoso.com" -TelephoneNumber "12125551234"
    
    #build list of userIds to add to the call queue
    $userIds = get-msoluser | Where-Object {$_.UserPrincipalName -in @("user1@contoso.com", "user2@contoso.com")} | Select -Expand ObjectId
    
    # Create call queue and add users
    New-CsCallQueue -Name testCQ1 -Users $userIds 
    
    #get application id and call queue id
    $applicationInstanceId = (Get-CsOnlineUser "testra1@contoso.com")[-1].ObjectId
    $callQueueId = (Get-CsCallQueue -NameFilter "testCQ1").Identity
    
    #make the connection
    New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceId) -ConfigurationId $callQueueId -ConfigurationType CallQueue

     

    <Reference Links>:

    https://ucstatus.com/2019/05/14/how-to-assign-a-direct-routing-number-to-an-auto-attendant-or-call-queue-in-microsoft-teams-phone-system/

    https://docs.microsoft.com/en-us/microsoftteams/manage-resource-accounts#create-a-resource-account-in-powershell

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    Best Regards,
    Sharon Zhao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Monday, December 30, 2019 7:11 AM
    Moderator

All replies

  • Hi Simon,

    In my research, it seems that you can use the following command to create a resource account online for use with a Call Queue:

    New-CsOnlineApplicationInstance -UserPrincipalName testra1@contoso.com -ApplicationId “11cd3e2e-fccb-42ad-ad00-878b93575e07” -DisplayName "Resource account 1"

    The parameter “ApplicationId” is the application ID that you need to use while creating the application instances are:

    Auto Attendant: ce933385-9390-45d1-9512-c8d228074e07

    Call Queue: 11cd3e2e-fccb-42ad-ad00-878b93575e07

    For more details, please refer to:

    https://ucstatus.com/2019/05/14/how-to-assign-a-direct-routing-number-to-an-auto-attendant-or-call-queue-in-microsoft-teams-phone-system/

    https://docs.microsoft.com/en-us/microsoftteams/manage-resource-accounts#create-a-resource-account-in-powershell

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    Best Regards,
    Sharon Zhao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Tuesday, December 3, 2019 4:50 AM
    Moderator
  • Thanks Sharon,

    I did manage to create a Resource Account, assign a license and PSTN number to it using PowerShell.

    I also managed to create a Call Queue using PowerShell.

    What I would like to do now is to associate the the Resource Account with the Call Queue also using PowerShell.


    Simon

    Tuesday, December 3, 2019 7:47 AM
  • Hi Simon,

    I didn’t find the related command to realize this for now.

    I will continue to search the related command. If there is any update, I will share with you.


    Best Regards,
    Sharon Zhao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Friday, December 6, 2019 10:14 AM
    Moderator
  • Hi Simon,

    Is there any update on this case?

    Please feel free to drop us a note if there is any update.

    Have a nice day!


    Best Regards,
    Sharon Zhao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Wednesday, December 25, 2019 9:30 AM
    Moderator
  • In order to make this work, it is first necessary to assign a UsageLocation to the Msol User of the application instance.  

    # create application instance
    New-CsOnlineApplicationInstance -UserPrincipalName testra1@contoso.com -ApplicationId “11cd3e2e-fccb-42ad-ad00-878b93575e07” -DisplayName "Resource account 1"
    
    # set location
    Set-MsolUser -UserPrincipalName "testra1@contoso.com" -UsageLocation US
    
    # add virtual license
    Set-MsolUserLicense -UserPrincipalName testra1@contoso.com -AddLicenses "contosocom:PHONESYSTEM_VIRTUALUSER"
    
    #Set phone number
    Set-CsOnlineVoiceApplicationInstance -Identity "testra1@contoso.com" -TelephoneNumber "12125551234"
    
    #build list of userIds to add to the call queue
    $userIds = get-msoluser | Where-Object {$_.UserPrincipalName -in @("user1@contoso.com", "user2@contoso.com")} | Select -Expand ObjectId
    
    # Create call queue and add users
    New-CsCallQueue -Name testCQ1 -Users $userIds 
    
    #get application id and call queue id
    $applicationInstanceId = (Get-CsOnlineUser "testra1@contoso.com")[-1].ObjectId
    $callQueueId = (Get-CsCallQueue -NameFilter "testCQ1").Identity
    
    #make the connection
    New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceId) -ConfigurationId $callQueueId -ConfigurationType CallQueue


    Simon

    Wednesday, December 25, 2019 9:52 AM
  • Hi Simon,

    Thanks for your sharing.

    Meanwhile, if there is no issue, please remember to mark helpful reply as answer to close the thread. Your action would be helpful to other users who encounter the same issue and read this thread.

    Thanks for your understanding.


    Best Regards,
    Sharon Zhao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Monday, December 30, 2019 2:52 AM
    Moderator
  • Here I will provide a brief summary of this post. This will make answer searching easier in the forum .

     

    <Request/Expectation>:

    I can create a Resource Account and a Call Queue using PowerShell, but I don't see how to add that account to the Call Queue using PowerShell.

     

    <Suggestions>:

    In order to make this work, it is first necessary to assign a UsageLocation to the Msol User of the application instance.

    # create application instance
    New-CsOnlineApplicationInstance -UserPrincipalName testra1@contoso.com -ApplicationId “11cd3e2e-fccb-42ad-ad00-878b93575e07” -DisplayName "Resource account 1"
    
    # set location
    Set-MsolUser -UserPrincipalName "testra1@contoso.com" -UsageLocation US
    
    # add virtual license
    Set-MsolUserLicense -UserPrincipalName testra1@contoso.com -AddLicenses "contosocom:PHONESYSTEM_VIRTUALUSER"
    
    #Set phone number
    Set-CsOnlineVoiceApplicationInstance -Identity "testra1@contoso.com" -TelephoneNumber "12125551234"
    
    #build list of userIds to add to the call queue
    $userIds = get-msoluser | Where-Object {$_.UserPrincipalName -in @("user1@contoso.com", "user2@contoso.com")} | Select -Expand ObjectId
    
    # Create call queue and add users
    New-CsCallQueue -Name testCQ1 -Users $userIds 
    
    #get application id and call queue id
    $applicationInstanceId = (Get-CsOnlineUser "testra1@contoso.com")[-1].ObjectId
    $callQueueId = (Get-CsCallQueue -NameFilter "testCQ1").Identity
    
    #make the connection
    New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceId) -ConfigurationId $callQueueId -ConfigurationType CallQueue

     

    <Reference Links>:

    https://ucstatus.com/2019/05/14/how-to-assign-a-direct-routing-number-to-an-auto-attendant-or-call-queue-in-microsoft-teams-phone-system/

    https://docs.microsoft.com/en-us/microsoftteams/manage-resource-accounts#create-a-resource-account-in-powershell

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    Best Regards,
    Sharon Zhao


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Monday, December 30, 2019 7:11 AM
    Moderator