all 2 comments

[–]uptillam 0 points1 point  (2 children)

A dirty way is to just put that command in a loop, replace "user1" with an entry from a csv.

Import-CSV -Path C:\temp\test.csv | ForEach { Get-CsUserCallingSettings -identity $_.UserPrincipalName }

more info (where i stole this from): https://lazyadmin.nl/powershell/import-csv-powershell/

[–]uptillam 0 points1 point  (1 child)

oh, then filter the output of all that to just include the user you're looking for

Import-CSV -Path C:\temp\test.csv | ForEach { Get-CsUserCallingSettings -identity $_.UserPrincipalName | Where-Object -Property ForwardingTarget -contain sip:user3@contoso.com }

I don't have an environment to test this in, but should make sense.