Powershell/.NET AD Search Request for Lync objects without using AD Module
This is more of an aide-memoir than anything else, but if you need to get user details, including Microsoft Lync SIP Address and Home Server and you can’t use Powershell Active Directory Module, then these are the Attribute Names you need to use to query the Lync Extended Attributes using the System.DirectoryServices.Protocols.SearchRequest class.
(and I wanted to play with Gist). Initially, I couldn’t find the correct names to use to pull out the SIP Address and Home Server. I’d already written something to get back users:
and was getting the information I need back using this:
but it wasn’t working when I added msRTCSIP-PrimaryUserAddress  into the Attributes list. I found out that if you left out the Attributes.Add entries completely, and didn’t have any, you got back all the Attributes. That meant I could scan the list, and find out that what I should be looking for was msrtcsip-primaryuseraddress – turns out it’s case-sensitive.