Skip to content

Getting FQDN of Skype for Business (Lync) pool

The following code sample gets the fully qualified domain name (FQDN) of the Registrar pool where the user’s Skype for Business account is homed.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Connect to the Adaxes service
$admNS = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$admService = $admNS.GetServiceDirectly("localhost")

# Bind to the user
$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"
$user = $admService.OpenObject("Adaxes://$userDN", $NULL, $NULL, 0)

# Get the Registrar pool FQDN
$poolFqdn = $user.GetLyncPoolFqdn()
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Adsi;
class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Bind to the user
        const string userPath = "Adaxes://CN=John Smith,CN=Users,DC=domain,DC=com";
        IADs user = (IADs)admService.OpenObject(userPath, null, null, 0);

        // Get the Registrar pool FQDN
        IAdmLyncOps lyncOps = (IAdmLyncOps)user;
        String poolFqdn = lyncOps.GetLyncPoolFqdn();
    }
}

See also