Match Lync SIP address with AD user name

We have a CSV list of Lync SIP logins (ex., but need to match this list with their Active Directory usernames and/or employeeID. GET-CSuser will not return the necessary AD variable. Anyone have any ideas? Thanks.


Could you not…

$sip = “
$username = $sip -replace “”,“”
Get-ADUser -Identity $username


Maybe use the AD Module if SIP is the same as mail address?

Import-Csv .\LyncSip.csv | %{Get-ADUser -Filter "Mail -eq '$($_.sip)'"}

Sorry for the confusion…What we need from the list of sip addresses is to query AD for the actual AD usernames (specifically employeeid attribute) of the user. Some of the users do not have an email address (most do) that would match their sip address.

So, what’s in the CSV? You said the SIP address was “” - is that not the username?

In other words, what’s in the CSV, specifically, that you can match to something in AD?

Here is a sample I came up just to show the theory. Not exactly what you need but it could be a good start.

Import-Csv .\UserSips.csv |
%{Get-ADUser -Filter "msRTCSIP-PrimaryUserAddress -eq 'sip:$($_.sip)'" -Properties employeeID |
select employeeID}



Is that what you were looking for?

Edit: I must be a slow typist. Don is always 2 minutes ahead of me by the time I hit submit.