Forum Discussion

BBachtell6982's avatar
BBachtell6982
Copper Contributor
Jan 12, 2026
Solved

Extract telephoneNumber/businessPhones in Graph via PowerShell

Hi all,

 

I am trying to extract the telephoneNumber from the businessPhones attribute in Entra via a PowerShell script. I call Get-MgUser, list the properties including businessPhones. No matter what I try I either get a System.String[] or a blank. I can extract all the extensionAttribute values using the dot operator, but no luck with telephoneNumber. After much searching and reading of the Learn documentation, I am rather stumped.

Any guidance will be appreciated. 

Bruce

2 Replies

  • BBachtell6982's avatar
    BBachtell6982
    Copper Contributor

    VasilMichev,

    When I did not export the results via the Export-Csv commandlet, all was good. The issue here was the curly braces around the businessPhone return value. I stripped the curly braces off, piped it to the Export-Csv commandlet, got the result I needed. I was way overcomplicating the issue.

    Thank you. I have marked your answer as a solution because it did lead me down the correct path to a solution.

    Bruce

Resources