Thursday, March 1, 2012

Lync Server 2010 : Address Book Isolation - How it works ?

MSLync-logo-3

fr French version below

Everything is in the question. One of my colleague ask me, a week ago : “How can Lync isolate address books in case of hosted environment with several customers?” My first reaction was: “Don’t know maybe this will be possible with Service Pack 1”. Finally we look for an answer on internet and we found some ideas. The best one was by using the Active Directory Lync Attribute msRTCSIP-GroupingID.

The msRTCSIP-GroupingID, in Lync Server 2010 RTM is “null” by default as you can see on the picture below:

Some information are in the following TechNet article : http://technet.microsoft.com/en-us/library/gg429725.aspx 

But everything is not in… Looking for a script to update the msRTCSIP-GroupingID was an impossible mission no-one over the internet seems to post something like that until now Smile with tongue out

To update the msRTCSIP-GroupingID you need to know the objectGUID of your parent Active Directory Object (an OU). Very simple in Powershell:

$Grouping_ID = ((Get-ADOrganizationalUnit -Identity $OU_Path).ObjectGUID).ToByteArray()

Do not forget the “ToByteArray()” it’s very important to convert the GUID string to ByteArray, if you don’t do that de $Grouping_ID will be wrong and it don’t work at all.

Then after an Active Directory Lookup in the parent simply set the attribute using [ADSI]  :

$User = [ADSI]$UserDN
$User.Put("msrtcsip-groupingid",$Grouping_ID)
$User.SetInfo()

You can download a copy of the full script HERE.

Well after isolating addresses book you can see in the Lync share folder that new entries has been created.

When looking for users in my Lync client I just see those who are in my parent OU.

And the best thing with this usage of the msRTCSIP-GroupingID attribute, is that Microsoft France confirmed the support of this kind of address book isolation Hot smile


gb English version above

Tout est dans la question. Il y a une semaine, un collègue vient me voir et me demande: “Tu sais comment isoler les carnets d’adresses dans Lync dans le cadre d’un environnement hosté?”. Ma première réaction fut: “Je ne crois pas… Surement avec le Service Pack 1”. Au final le problème étant intéressant, nous avons commencer nos recherches sur internet et avons trouvé quelques idées. La meilleure d’entre elle était d’utiliser l’attribut Active Directory msRTCSIP-GroupingID créé avec l’upgrade de schéma Lync.

L’attibut msRTCSIP-GroupingID, dans Lync Server 2010 RTM a pour valeur “null” par défaut comme le montre la capture d’écran ci-dessous :

Quelques explications se trouvent dans l’article Technet suivant : http://technet.microsoft.com/en-us/library/gg429725.aspx

Malheureusement tout n’était pas disponible… Si l’on recherche un script permettant de mettre à jour l’attribut msRTCSIP-GroupingID cela devient mission impossible, personne ne semblait avoir posté d’articles avec script sur Internet jusqu’à aujourd’hui Smile with tongue out

Le principe est simple pour mettre à jour le msRTCSIP-GroupingID, il est nécessaire de connaitre l’objectGUID de l’objet Active Directory parent (généralement un UO). Jusque la c’est très simple avec Powershell :

$Grouping_ID = ((Get-ADOrganizationalUnit -Identity $OU_Path).ObjectGUID).ToByteArray()

Très important, ne pas retirer le “ToByteArray()”, car c’est cette fonction qui va convertir la chaine de GUID dans un tableau de Byte compris et valide pour l’attribut AD. Sans l’appel la valeur contenue dans $Grouping_ID sera fausse et le script non fonctionnel.

Do not forget the “ToByteArray()” it’s very important to convert the GUID string to ByteArray, if you don’t do that de $Grouping_ID will be wrong and it don’t work at all.

Une fois la recherche AD effectuée sur les objets enfants il suffit de leur appliquer la valeur de l’attribut en utilisant [ADSI] :

$User = [ADSI]$UserDN
$User.Put("msrtcsip-groupingid",$Grouping_ID)
$User.SetInfo()

Vous pourrez télécharger le script complet ICI.

Une fois l’isolation terminée pour vos différentes UO vous pourrez constater la création de nouveau répertoire dans les répertoires partagés de Lync :

Enfin, lors de la recherche d’utilisateurs dans un client Lync seul ceux référencés dans l’UO parente seront visibles.

Le meilleur dans tout cela c’est que l’utilisation faite du msRTCSIP-GroupingID, est parfaitement supportée par Microsoft et confirmé par Microsoft France Hot smile

2 comments:

  1. Hi, great post and script - question: does the script allow for sub-OUs?
    For example, if I have an Accounts OU that hosts 5 sub-Ou's for my customers, each customer having their own OU. I want to set the attribute for Customer A so that the users in Customer A's Users sub-OU can only have users in that same OU in the address book can it be done? To graphically show the structure:
    Domain top level
    -Accounts OU
    |
    ---Company A
    |
    ----Company A Users
    |
    ---Company B
    |
    ----Company B Users

    etc.

    Company A users should not be able to find Company B users doing an address book search.

    Look forward to your reply.
    Thanks,
    Steve

    ReplyDelete
  2. Sadly, my formatting didn't come out right, but you get the idea. Company A Users is a sub-OU of Company A, which is a sub-OU of Accounts, an OU in the domain root.

    ReplyDelete