Forum Discussion

rsmoot's avatar
rsmoot
Copper Contributor
Mar 31, 2022

Deleted Resource account with phone number still assigned.

At the bottom Manage resource accounts in teams, there is a section for deleting resource accounts. 

Manage resource accounts in Teams - Microsoft Teams | Microsoft Docs

 

It states: Make sure you dissociate the telephone number from the resource account before deleting it, to avoid getting your service number stuck in pending mode.

 

My question is: what happens if you forgot to unassign the phone number from the resource account before deleting it? 😐 

 

I worked with a tech from Support and he had me try several powershell commands, but nothing worked. He is going to get back to be, but I thought I'd ask here! 

  • If you delete a resource account without first removing the phone number you can run Get-CsPhoneNumberAssignment -TelephoneNumber <+phonenumber> and note the AssignedPstnTargetId which is the Identity of the deleted Resource Account.

    Then run the following to remove the number.
    Remove-CsPhoneNumberAssignment -Identity <AssignedPstnTargetId> -PhoneNumber <+phonenumber to unassign> -PhoneNumberType <DirectRouting|CallingPlan|OperatorConnect>

  • If you delete a resource account without first removing the phone number you can run Get-CsPhoneNumberAssignment -TelephoneNumber <+phonenumber> and note the AssignedPstnTargetId which is the Identity of the deleted Resource Account.

    Then run the following to remove the number.
    Remove-CsPhoneNumberAssignment -Identity <AssignedPstnTargetId> -PhoneNumber <+phonenumber to unassign> -PhoneNumberType <DirectRouting|CallingPlan|OperatorConnect>

    • LloydSavage's avatar
      LloydSavage
      Copper Contributor

      If you delete a resource account via the Microsoft 365 Admin center, you can complete wipe it away from your tenant by accessing the "deleted users" under the Microsoft Entra admin center...select the offending account and "delete permanently"!

       

       

    • vorsite's avatar
      vorsite
      Copper Contributor

      I haven't tried this but if this works, this is a great solution. Typically you need to open a support case with Microsoft and it takes 2-3 days to find the right contact and reach a resolution. Greg Anthony 

  • nharwood's avatar
    nharwood
    Copper Contributor
    I had the same issue but managed to resolve it by going to the Azure AD admin centre and purging the deleted resource account from deleted users.

    Took about 30mins from the list when running the command "Get-CsPhoneNumberAssignment -PstnAssignmentStatus VoiceApplicationAssigned"
  • Martin-17's avatar
    Martin-17
    Copper Contributor
    Exactly the same issue here. Number still seems to be in limbo, resource account has been removed but the direct routing number cannot be assingned to another user as it still thinks its in use.

    Looking at the PSTN logs via Teams the calls are still pointing to the old resource account.

    Ive had a ticket open for a month with Microsoft support and we are no further forward with a resolution. Does anyone know how this can be resolved?
  • DeanCB's avatar
    DeanCB
    Copper Contributor

    In the same boat.  Have a ticket open with MS now on this.  Hopefully I'll get an answer and can come back here and reply.

  • lonestar1978's avatar
    lonestar1978
    Copper Contributor

    rsmoot 

     

    Hellas,

     

    We're stuck with the same problem. Our IT partner deleted the Resource Account with our main office Number. And now we're stuck with the problem as mentionned by others.

     

    Unfortunately nothing helps via Azure. We're in contact with Microsoft but it takes ages to explain and to deliver log-files and re-explain.

     

    Any one any idea how to speed things up?

     

    Regards

    André

  • Rigel185's avatar
    Rigel185
    Copper Contributor

    This is what worked for me.

     

    I got the AssignedPstnTargetId of the phone number from running this command “Get-CsPhoneNumberAssignment -PstnAssignmentStatus VoiceApplicationAssigned”.

     

    I then ran the command using the value of AssignedPstnTargetId for the Identity.

    “Remove-CsPhoneNumberAssignment -Identity ‘AssignedPstnTargetId’ -RemoveAll”

Resources