Haiku #57

There are two kinds of

People in the world: users

And AD contacts.

Many years ago the humorist Robert Benchley noted that, "There are two kinds of people in the world: those who believe there are two kinds of people in the world and those who don't." Ever since then, people have hopped onto the "There are two kinds of people in the world" bandwagon, trying their hardest to outdo Benchley. For example:

· "There are two kinds of people: those who do the work and those who take the credit." – Indira Gandhi

· "There are two types of people in this world, good and bad. The good sleep better, but the bad seem to enjoy the waking hours much more." – Woody Allen

· "There are two kinds of people, those who finish what they start and so on." – Robert Byrne

· "There are two kinds of people: some willing to work and the rest willing to let them." – Robert Frost

These quotes are fun and these quotes are clever, so you just know that Microsoft would have to get involved. And we did: in Microsoft in Lync Server 2010, we've divided the world into two kinds of people: users and AD contacts.

Note. OK, true. But here at Microsoft that does count as fun and clever. After all, there are two kinds of people in the world: those people who understand what fun is, and those people who work at – well, never mind. We tend to get ourselves into enough trouble as it is.

We all know what a user is, and we know how to retrieve user information by using the Get-CsUser and Get-CsAduser cmdlets. But what exactly is an AD contact? To tell you the truth, it took us awhile to figure that out ourselves. When we first started working with Lync Server PowerShell we assumed that an AD contact was a regular old Active Directory contact. With that in mind, we created an Active Directory contact and then ran the Get-CsAdContact cmdlet in order to return information about that contact. We got back … well, nothing. So we created another contact, ran Get-CsAdContact again and got back – well, let's put it this way. There are two kinds of people in the world: those who can run a Lync Server PowerShell cmdlet and get back the expected data, and us.

Our next thought was, "Oh, wait: they're probably talking about the contact objects created by other Lync Server cmdlets, like New-CsDialInConferencingAccessNumber." With that in mind, we used several of these cmdlets and created a bunch of different kinds of contact objects. We then ran Get-CsAdContact and got back – and stop us if you've heard this one before – nothing.

Which was especially distressing in light of the fact that we were messing around with Get-CsAdContact because we assumed it would be very simple and very straightforward.

Note. Yes, we probably should stop assuming things.

Eventually, we uncovered the truth: Get-CsAdContact does not return regular old Active Directory contacts, nor does it return the contact objects created by other Lync Server cmdlets. Instead, Get-CsAdContact is only used in multi-forest scenarios: the cmdlet lets you retrieve information about users from forests other than your home forest. If you have a multi-forest setup, and if you have user accounts that were replicated using Microsoft Forefront Identity Manager 2010 (or some previous version of the software) then those user accounts will be retrieved by the Get-CsAdContact cmdlet. If you don’t have a multi-forest setup or if you don't have user accounts that were replicated using Forefront Identity Manager, well, then Get-CsAdContact isn’t going to do much of anything.

Note. For those of you who like the technical details, Get-CsAdContact looks for accounts where there's a value assigned to the msRTCSIP-OriginatorSid attribute.

In other words, many of you won't have much need for the Get-CsAdContact cmdlet. For those who do have a need for Get-CsAdContact, well, we have good news for you: the cmdlet is pretty darn easy to use. Need a list of all your AD contacts? No problem:

Get-CsAdContact

Or maybe you need information about a particular AD contact? Okey-doke:

Get-CsAdContact –Identity "Ken Myer"

All the AD contacts in a particular OU? All you had to do was ask:

Get-CsAdContact –OU "OU=FabrikamUsers,dc=litwareinc,dc=com"

Or maybe you'd like to use the LdapFilter or the Filter parameters. The LdapFilter parameter lets you select contacts based on a generic Active Directory attribute like Organization:

Get-CsAdContact –LdapFilter "Organization=Fabrikam"

By comparison, the Filter parameter lets you filter on Lync Server-specific attributes:

Get-CsAdContact –Filter {EnterpriseVoiceEnabled –eq $True}

That's what we keep trying to tell you: around here, the fun never ends.

Before you ask, no, there is no Set-CsAdContact cmdlet; these contact objects are read-only. If you need to modify the properties for one of these user accounts, you'd need to fire up Windows PowerShell, connect to the remote forest, then use the Set-CsUser cmdlet to make the required changes. (Which, of course, assumes that you have permission to do any of that in the first place.)

And there you have it. Or, as we like to say " There are 10 kinds of people in the world: those who think in binary and those who don't."

Note. Because, see, in binary 10 is really 2 and – well, OK. We'll just go now.