question

Ramki-5805 avatar image
0 Votes"
Ramki-5805 asked Ramki-5805 commented

In Teams. Lineuri to UserPrincipalName

Hi All


Scenario : i a bunch of Lineuri Numbers, in txt or CSV

i would like to get the Userprincipal Name, and Policy assinged to it.

can u help me

office-teams-windows-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YukiSun-MSFT avatar image
0 Votes"
YukiSun-MSFT answered Ramki-5805 commented

Hi @Ramki-5805,

Scenario : i a bunch of Lineuri Numbers, in txt or CSV
i would like to get the Userprincipal Name, and Policy assinged to it.

Let's say the file includes the Lineuri numbers is formatted as follows and is located at "C:\test\1.csv":
204900-1.png

You can try copying the script below into Notepad, saved it as a .ps1 file and then run it from PowerShell. Then you would be able to get the UserPrincipalName and policies based on LineUri values and the result would be exported into a CSV file(c:\test\result.csv) :

 $LineURIs = Import-Csv C:\test\1.csv    
 $Data = @()    
 foreach($LineURI in $LineURIs){    
     $Data+=Get-CsOnlineUser | where{$_.LineURI -eq $LineURI.LineUri} | select LineUri,UserPrincipalName,*Policy*
     }    
 $Data | Export-Csv c:\test\result.csv -NoTypeInformation

204944-2.png


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1.png (4.2 KiB)
2.png (16.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Ramki-5805,

Just circling back to follow up with this thread. Please let us know if the provided suggestion is helpful or if you need any further assistance.

0 Votes 0 ·

Excellant !

0 Votes 0 ·