Share via

Microsoft Teams PowerShell command returning nothing

Anonymous
2022-03-09T18:23:53+00:00

Hello,

I am trying to work on a script that can get me the unassigned phone numbers and assign it to a user via PowerShell but when I run the following commands, it returns nothing. I have tried MicrosoftTeams modules 2.0.0-4.0.0.

Connect-MicrosoftTeams

Get-CsOnlineTelephoneNumber -IsNotAssigned

What is returns is my account/enviroment/tenant/tenantId followed by a huge whitespace.

Maybe I'm going about it the wrong way but I would like some guidance as I am new-ish to Powershell.

Thank you!

Microsoft Teams | Microsoft Teams for business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-03-11T16:24:31+00:00

    Unfortunately that does the same thing with an even greater whitespace. If I use other filters and feed it information it works but just the command alone returns nothing :(

    EDIT: I ran this

    Connect-MicrosoftTeams

    Get-CsOnlineTelephoneNumber -IsNotAssigned | ft Id

    and it provided the unassigned numbers :) Thank you for providing the documentation.

    But is there a way for it to feed the number instead of the id?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-03-10T02:37:25+00:00

    Hi Abdel

    Greetings

    Thank you for posting in Microsoft Community.

    Regarding your query, please try to run the Get-CsonlineTelephoneNumber command this should show all phone numbers available in your tenant, both assigned and unassigned.

    I tested on my end only down side is no telephone numbers are assigned to my test tenant so I got the following results :

     

    You may refer to the following article for more information: See a list of telephone numbers in your organization - Microsoft Teams | Microsoft Docs

    Please feel free to let me know how it goes.

    Kind Regards,

    Momo

    Was this answer helpful?

    0 comments No comments