Forum Discussion
ramki1465
Apr 27, 2023Brass Contributor
Lineuri to UPN - Help Urgent
Hello Team Looking for some urgent to help i have list of around 1000+ LINEURI numbers and i using the below small script to get the output of who is using these numbers from Teams powehell. ...
- Apr 28, 2023
Hello Ramki
You could do a Write-Host $USer.num to see what numbers you are trying to match on the -eq query. There is probably something going wrong there. It looks like your format might be off or it might be recognized as an object instead of a number.
You can do what you are trying to achieve as follows:
Make sure your CSV is built as follows in one column with title NUMBER and all numbers underneath in format tel:[E164], for example tel:+3212345678.
Like so:
NUMBER
tel:[E164]
tel:[E164]
...
Then run this script:
$numberList = Import-Csv [FILEPATH]
Foreach ($num in $numberList) {
Get-CsOnlineUser | Where-Object {$_.LineURI -eq $num.NUMBER} | Select-Object UserPrincipalName, LineURI, EnterpriseVoiceEnabled, AccountEnabled}
It will take a while but it'll do the trick.
Kind regards!
KilianTyncke
Apr 28, 2023Copper Contributor
Hello Ramki
You could do a Write-Host $USer.num to see what numbers you are trying to match on the -eq query. There is probably something going wrong there. It looks like your format might be off or it might be recognized as an object instead of a number.
You can do what you are trying to achieve as follows:
Make sure your CSV is built as follows in one column with title NUMBER and all numbers underneath in format tel:[E164], for example tel:+3212345678.
Like so:
NUMBER
tel:[E164]
tel:[E164]
...
Then run this script:
$numberList = Import-Csv [FILEPATH]
Foreach ($num in $numberList) {
Get-CsOnlineUser | Where-Object {$_.LineURI -eq $num.NUMBER} | Select-Object UserPrincipalName, LineURI, EnterpriseVoiceEnabled, AccountEnabled}
It will take a while but it'll do the trick.
Kind regards!
ramki1465
Apr 30, 2023Brass Contributor
really thaks from my bottom of heart for your guidelines.. let me excutre and come back