Forum Discussion
Deleted Resource account with phone number still assigned.
- Jan 29, 2024
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>
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”