Share via

MS Teams powershell command to get users based on line uri

Anonymous
2024-01-02T14:38:44+00:00

Hi Folks,

Happy new year ๐ŸŽŠ

We have an requirement to get users based on the number starts with a particular pattern.

We know a command which is Get-CsOnlineUser -Filter "LineURI -like 'tel:+12031231234'"

This will give result only for +12031231234, we need a command which will filter numbers starts with +1203......

So any number starts with +1203 we will get all the entries.

Could you please help me with this ?

Thanks in Advance

Microsoft Teams | Microsoft Teams for business | Tasks | 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
    2024-01-02T17:39:52+00:00

    Rajdeep, you can use the following.

    get-csonlineuser | where-object {$_.lineuri -like "tel:+123*"}| select userprincipalname,lineuri

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-01-02T16:28:26+00:00

    Hi Rajdeep

    Iโ€™m Garcia and I will be happy to help you with your question, I am a Microsoft consumer like you. Additionally, this is a user support forum and Independent Advisors cannot access accounts.

    Try using the -like operator with a wildcard (*) in your filter.

    Get-CsOnlineUser -Filter "LineURI -like 'tel:+1203*'"

    I hope this helps

    To avoid misunderstanding, this is a public user-to-user support forum. We're users helping other users. We do not work for Microsoft and have no access to any user account so there is nothing we can do or check from within the forum. We have no input on Microsoft's policies, procedures, or design decisions.

    Give back to the Community. Help the next person with this issue by indicating if this reply solved your problem. Click Yes or No below.

    Was this answer helpful?

    0 comments No comments