Pages Menu
TwitterRssFacebook

Posted by on Mar 1, 2013 in Development

Powershell/.NET AD Search Request for Lync objects without using AD Module

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.

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.