<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Joe Calev's WebLog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jcalev/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jcalev/feed.xml</link>
    <description>Posts and information about Microsoft Office Communications Server and sometimes off topic posts.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:10:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Debugging Lync Delegation</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/debugging-lync-delegation</link>
      <pubDate>Mon, 16 Jun 2014 16:20:43 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2014/06/16/debugging-lync-delegation/</guid>
      <description><![CDATA[Why is my admin not able to act as a delegate?&nbsp; How can I check whether delegation is even...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: Calibri;">Why is my admin not able to act as a delegate?&nbsp; How can I check whether delegation is even setup?&nbsp; These are great questions and it occurred to me after I spent some time searching that no one has ever bothered to explain exactly how delegation works.&nbsp; With that in mind I present the following &ndash; which some may find useful when debugging while others simply find it interesting to know.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">While this may not be completely obvious, delegation is a presence feature whose configuration is well documented in MS-PRES.&nbsp; This covers in gory details how to add, change, and remove a delegate.&nbsp; What it does not cover at all is how the delegate and delegator learn of the relationship and how this information is stored.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><strong>No delegation configured</strong></span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">So let&rsquo;s start at the very beginning with two users &ndash; Boss and Admin &ndash; who do not have a delegation relationship setup.&nbsp; We are about to configure this, but before we do we need to examine sign in for both users.&nbsp; During sign in both users will self subscribe using a message similar to the following (note that some headers have been removed for brevity).</span></span></p>
<p><strong><span style="font-family: Calibri;">SUBSCRIBE sip:admin@vdomain.com SIP/2.0</span></strong><br /><span style="font-family: Calibri;"><strong>Via</strong>: SIP/2.0/TLS 192.168.0.240:52386</span><br /><span style="font-family: Calibri;"><strong>From</strong>: &lt;sip:admin@vdomain.com&gt;;tag=bd94be2ff5;epid=fc44a406d8</span><br /><span style="font-family: Calibri;"><strong>To</strong>: &lt;sip:admin@vdomain.com&gt;</span><br /><span style="font-family: Calibri;"><strong>Call-ID</strong>: 0423f26f9e6c40db8dda82276cbddd9d</span><br /><span style="font-family: Calibri;"><strong>CSeq</strong>: 1 SUBSCRIBE</span><br /><span style="font-family: Calibri;"><strong>Contact</strong>: &lt;sip:admin@vdomain.com;opaque=user:epid:zov38nE9AlKRNqjgsU-A_AAA;gruu&gt;</span><br /><span style="font-family: Calibri;"><strong>Event</strong>: vnd-microsoft-roaming-self</span><br /><span style="font-family: Calibri;"><strong>Accept</strong>: application/vnd-microsoft-roaming-self+xml</span><br /><span style="font-family: Calibri;"><strong>Supported</strong>: com.microsoft.autoextend</span><br /><span style="font-family: Calibri;"><strong>Supported</strong>: ms-benotify</span><br /><span style="font-family: Calibri;"><strong>Supported</strong>: ms-piggyback-first-notify</span><br /><span style="font-family: Calibri;"><strong>Content-Type</strong>: application/vnd-microsoft-roaming-self+xml</span><br />-<span style="font-family: Calibri;"> &lt;roamingList&nbsp; xmlns="<strong>https://schemas.microsoft.com/2006/09/sip/roaming-self</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;roaming&nbsp; type="<strong>categories</strong>"/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;roaming&nbsp; type="<strong>containers</strong>"/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;roaming&nbsp; type="<strong>subscribers</strong>"/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;roamingEx&nbsp; xmlns="<strong>https://schemas.microsoft.com/2007/09/sip/roaming-self-ex</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">type="<strong>delegates</strong>"/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&lt;/roamingList&gt;</span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">The two that we care about are the subscribers and delegates categories.&nbsp; As we will see shortly, these will be key to understanding delegation.&nbsp; Before we setup delegation, however, let&rsquo;s have boss add admin as a contact and see what happens.&nbsp; We&rsquo;ll skip the details of adding a contact though and instead concentrate on the prompted subscriber &ndash; that prompt that tells admin that boss added her as a contact.&nbsp; How does she receive this notification &ndash; through the subscribers category subscription of course.</span></span></p>
<p><strong><span style="font-family: Calibri;">NOTIFY sip:192.168.0.240:52807;transport=tls;ms-opaque=a589590cd5;ms-received-cid=1ABE500;grid SIP/2.0</span></strong><br /><span style="font-family: Calibri;"><strong>To</strong>: &lt;sip:admin@vdomain.com&gt;;tag=de5be0b9f5;epid=fc44a406d8</span><br /><span style="font-family: Calibri;"><strong>Content-Length</strong>: 636</span><br /><span style="font-family: Calibri;"><strong>From</strong>: &lt;sip:admin@vdomain.com&gt;;tag=79520080</span><br /><span style="font-family: Calibri;"><strong>Call-ID</strong>: 904acbdc96704c16afe7206e92e7fd09</span><br /><span style="font-family: Calibri;"><strong>CSeq</strong>: 4 NOTIFY</span><br /><span style="font-family: Calibri;"><strong>Require</strong>: eventlist</span><br /><span style="font-family: Calibri;"><strong>Content-Type</strong>: application/vnd-microsoft-roaming-self+xml</span><br /><span style="font-family: Calibri;"><strong>Event</strong>: vnd-microsoft-roaming-self</span><br /><span style="font-family: Calibri;"><strong>Supported</strong>: ms-dialog-route-set-update</span></p>
<p>-<span style="font-family: Calibri;"> &lt;roamingData&nbsp; xmlns="<strong>https://schemas.microsoft.com/2006/09/sip/roaming-self</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">sub="<strong>https://schemas.microsoft.com/2006/09/sip/presence-subscribers</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;subscribers&nbsp; xmlns="<strong>https://schemas.microsoft.com/2006/09/sip/presence-subscribers</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>+<span style="font-family: Calibri;"> &nbsp;&lt;subscriber&nbsp; user="<strong>boss@vdomain.com</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">displayName="<strong>MrBoss Bosso</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">acknowledged="<strong>false</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">type="<strong>sameEnterprise</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/subscribers&gt;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Let&rsquo;s not acknowledge it just yet, but instead take a look at what we have in the database.&nbsp; You&rsquo;ll need to look at the database for admin&rsquo;s FE, which if you do not know where it is located you can find with</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Get-CsUserPoolInfo admin@vdomain.com | select-object PrimaryPoolPrimaryRegistrar</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Now at the database the following will provide the prompted subscriber list.</span></span></p>
<p>select r1.UserAtHost as Publisher, r2.UserAtHost as Subscriber, p.Permanent, p.AuthMask, p.Ackd, convert(varchar(4000), convert(varbinary(4000), p.Context)) as Context</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from rtc.dbo.PromptedSubscriber as p</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join dbo.Resource as r1</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on r1.ResourceId = p.PublisherId</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join rtc.dbo.Resource as r2</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on r2.ResourceId = p.SubscriberId</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where r1.UserAtHost = 'admin@vdomain.com'</p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Notice that Ack&rsquo;d is 0, but what is more interesting is the Context.</span></span></p>
<p>&lt;subscriptionContext xmlns="https://schemas.microsoft.com/2008/09/sip/SubscriptionContext" majorVersion="1" minorVersion="0"&gt;</p>
<p>&nbsp;&nbsp; &lt;watcher&gt;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;contactList&gt;&lt;/contactList&gt;</p>
<p>&nbsp;&nbsp; &lt;/watcher&gt;</p>
<p>&lt;/subscriptionContext&gt;</p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">This is not overly interesting, but play along for now.&nbsp; No ack the prompted subscriber message and query the table again.&nbsp; Since the prompted subscriber is ack&rsquo;d, we have removed the row from the database.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><strong>Delegation configured</strong></span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Now let&rsquo;s add admin as a delegate for boss.&nbsp; The following message from boss sets up the delegation.</span></span></p>
<p><span style="font-family: Calibri;">06/16/2014|15:44:25.561 F30:64C INFO&nbsp; :: </span><br /><strong><span style="font-family: Calibri;">SERVICE sip:boss@vdomain.com SIP/2.0</span></strong><br /><span style="font-family: Calibri;"><strong>From</strong>: &lt;sip:boss@vdomain.com&gt;;tag=d24448c9c5;epid=18dfefe32c</span><br /><span style="font-family: Calibri;"><strong>To</strong>: &lt;sip:boss@vdomain.com&gt;</span><br /><span style="font-family: Calibri;"><strong>Call-ID</strong>: bb1ff151b5364659a7c0dad4dcdc85c8</span><br /><span style="font-family: Calibri;"><strong>CSeq</strong>: 1 SERVICE</span><br /><span style="font-family: Calibri;"><strong>Contact</strong>: &lt;sip:boss@vdomain.com;opaque=user:epid:MRVYui97X1WRenSBv44FiwAA;gruu&gt;</span><br /><span style="font-family: Calibri;"><strong>Content-Type</strong>: application/msrtc-setdelegate+xml</span><br />-<span style="font-family: Calibri;"> &lt;setDelegates&nbsp; xmlns="<strong>https://schemas.microsoft.com/2007/09/sip/delegate-management</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">version="<strong>7</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;delegate&nbsp; uri="<strong>sip:admin@vdomain.com</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">action="<strong>add</strong>"/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&lt;/setDelegates&gt;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Boss will then see the following NOTIFY, telling her that the delegation has been configured.&nbsp; Note that this time it was sent back in the 200 OK response instead of in a separate NOTIFY.&nbsp; This happened because we indicated support for best effort NOTIFY (BENOTIFY) in the supported: ms-benotify header when we setup the subscription.</span></span></p>
<p><strong><span style="font-family: Calibri;">SIP/2.0 200 OK</span></strong><br /><span style="font-family: Calibri;"><strong>From</strong>: "MrBoss Bosso"&lt;sip:boss@vdomain.com&gt;;tag=d24448c9c5;epid=18dfefe32c</span><br /><span style="font-family: Calibri;"><strong>To</strong>: &lt;sip:boss@vdomain.com&gt;;tag=91831FC8D1A4176B2C748B9E0BB2DA10</span><br /><span style="font-family: Calibri;"><strong>Call-ID</strong>: bb1ff151b5364659a7c0dad4dcdc85c8</span><br /><span style="font-family: Calibri;"><strong>CSeq</strong>: 1 SERVICE</span><br /><span style="font-family: Calibri;"><strong>Content-Type</strong>: application/vnd-microsoft-roaming-self+xml</span></p>
<p>-<span style="font-family: Calibri;"> &lt;roamingData&nbsp; xmlns="<strong>https://schemas.microsoft.com/2006/09/sip/roaming-self</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">del="<strong>https://schemas.microsoft.com/2007/09/sip/delegates</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;delegates&nbsp; xmlns="<strong>https://schemas.microsoft.com/2007/09/sip/delegates</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">version="<strong>8</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;delegate&nbsp; uri="<strong>admin@vdomain.com</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">publish="<strong>false</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">redelegate="<strong>false</strong>"/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/delegates&gt;</span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">We can see that the delegation has been configured by examining the Delegate table on admin&rsquo;s front end.</span></span></p>
<p>select r1.UserAtHost as Delegator, r2.UserAtHost as Delegate, d.AuthMask from rtc.dbo.Delegate as d</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join dbo.Resource as r1</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on r1.ResourceId = d.DelegatorId</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inner join dbo.Resource as r2</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on r2.ResourceId = d.DelegateId</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where r1.UserAtHost = 'boss@vdomain.com'</p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">What is important to note here about delegation is this is the final source of information about delegation.&nbsp; In various cases when the server needs to know if a delegate relation exists, it will send a message to boss&rsquo;s front end, which will in turn lookup the relationship in this table.&nbsp; Only the delegate table on the boss&rsquo;s front end matters &ndash; not the table on the admin&rsquo;s front end.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Now comes the disclaimer &ndash; you may actually see these rows in other front ends because they are automatically replicated to the backup front ends.&nbsp; Therefore you may see the rows on admin&rsquo;s FE if that FE is a backup for boss&rsquo;s.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Now the question will naturally arise &ndash; how does admin learn that she is a delegate for boss?&nbsp; A quick examination of the delegate table on her FE will bring up nothing &ndash; so how is this stored and sent.&nbsp; The answer is related to the prompted subscriber notification sent earlier.&nbsp; A prompted subscriber message is sent to admin with one key difference.</span></span></p>
<p><strong><span style="font-family: Calibri;">NOTIFY sip:192.168.0.240:52807;transport=tls;ms-opaque=a589590cd5;ms-received-cid=1ABE500;grid SIP/2.0</span></strong><br /><span style="font-family: Calibri;"><strong>To</strong>: &lt;sip:admin@vdomain.com&gt;;tag=de5be0b9f5;epid=fc44a406d8</span><br /><span style="font-family: Calibri;"><strong>From</strong>: &lt;sip:admin@vdomain.com&gt;;tag=79520080</span><br /><span style="font-family: Calibri;"><strong>Call-ID</strong>: 904acbdc96704c16afe7206e92e7fd09</span><br /><span style="font-family: Calibri;"><strong>CSeq</strong>: 8 NOTIFY</span><br /><span style="font-family: Calibri;"><strong>Require</strong>: eventlist</span><br /><span style="font-family: Calibri;"><strong>Content-Type</strong>: application/vnd-microsoft-roaming-self+xml</span><br /><span style="font-family: Calibri;"><strong>Event</strong>: vnd-microsoft-roaming-self</span><br /><span style="font-family: Calibri;"><strong>Supported</strong>: ms-dialog-route-set-update</span></p>
<p>-<span style="font-family: Calibri;"> &lt;roamingData&nbsp; xmlns="<strong>https://schemas.microsoft.com/2006/09/sip/roaming-self</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">sub="<strong>https://schemas.microsoft.com/2006/09/sip/presence-subscribers</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;subscribers&nbsp; xmlns="<strong>https://schemas.microsoft.com/2006/09/sip/presence-subscribers</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;subscriber&nbsp; user="<strong>boss@vdomain.com</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">displayName="<strong>MrBoss Bosso</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">acknowledged="<strong>false</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">type="<strong>sameEnterprise</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;context&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;subscriptionContext&nbsp; xmlns="<strong>https://schemas.microsoft.com/2008/09/sip/SubscriptionContext</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: Calibri;">majorVersion="<strong>1</strong>"</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri;">minorVersion="<strong>0</strong>"&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &nbsp;&lt;watcher&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;contactList/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/watcher&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&nbsp;<span style="font-family: Calibri;">&nbsp;&nbsp;&lt;delegation/&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/subscriptionContext&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/context&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/subscriber&gt;</span><br /><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp; </span>-<span style="font-family: Calibri;"> &lt;/subscribers&gt;</span></p>
<p><span style="font-family: Calibri;">&nbsp;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">That little node called &ldquo;delegation&rdquo; is the key.&nbsp; You can see this context also if querying the PromptedSubscriber table.&nbsp; This element informs the client that this is no normal prompted subscriber but instead a delegation configuration.&nbsp; Admin now knows that she is a delegate for boss.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Unlike an actual prompted subscriber, however, the client never acknowledges it and the entry remains in admin&rsquo;s prompted subscriber table until the relationship is removed.&nbsp; From the server&rsquo;s perspective, this is simply an unacknowledged prompted subscriber and each time admin signs and self subscribes to her subscribers the server will respond with this one.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">So, now both admin and boss are aware of the delegation relationship.&nbsp; Boss will continue to see the relationship returned in the delegates category subscription each time she signs in and admin will continue to see the relationship in the subscribers category subscription with a context that contains the delegation element each time she signs in.&nbsp; The Delegate table on boss&rsquo;s front end will remain the master arbiter of delegate decisions until boss is moved to another machine or a failover occurs.</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Debugging address book issues with Debug-CsAddressBookReplication</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/debugging-address-book-issues-with-debug-csaddressbookreplication</link>
      <pubDate>Wed, 10 Oct 2012 15:51:04 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/10/10/debugging-address-book-issues-with-debug-csaddressbookreplication/</guid>
      <description><![CDATA[As I explained in a previous post, the address book component of Lync underwent major changes in...]]></description>
      <content:encoded><![CDATA[<p>As I explained in a previous post, the address book component of Lync underwent major changes in Lync Server 2013, but the basic functionality remains the same.&#160; Address Book is a deceivingly simple component.&#160; While how it works is easy to explain, there are a great number of things that may go wrong.&#160; Debugging issues can therefore become very difficult.</p>  <p>In Lync 2010, we introduced Powershell cmdlets such as Test-CsAddressBookWebQuery and Test-CsAddressBookService.&#160; The former is used to test the web query while the latter is used for file download.&#160; Documentation may be found within the management console (get-help <em>cmdlet-name</em>) and elsewhere online.&#160; These cmdlets are useful for determining <em>whether</em> a problem exists but are not as useful for determining <em>why</em>.</p>  <p>For this reason we have Debug-CsAddressBookReplication.&#160; This cmdlet provides a wealth of information about the replication process itself and provides the ability to process an individual user.&#160; There are several ways to use it.</p>  <p>This is the simplest use.</p>  <p><font face="Courier">PS C:\&gt; Debug-CsAddressBookReplication</font></p>  <p><font face="Courier">Pool Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : pool0.vdomain.com     <br />Replication State&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : NotTested      <br />Task Owner Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : SERVER.vdomain.com      <br />Backup Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : fakepool.vdomain.com      <br />Server Heartbeats&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : {Microsoft.Rtc.SyntheticTransactions.Activities.Database.AbServerHeartbe      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at}      <br />Indexed Object Count&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 122      <br />Objects not indexed that should be : 0      <br />Abandoned objects&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0      <br />Normalization Failure Count&#160;&#160;&#160;&#160;&#160;&#160;&#160; : Not checked      <br />Normalization Failures&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; :</font></p>  <p>When run without parameters, the cmdlet uses the default DC and whatever pool the machine is in.&#160; It provides the following general info.</p>  <p><strong>Pool Fqdn</strong> – This is the pool that was checked.</p>  <p><strong>Replication State</strong> – I will get to this one later.</p>  <p><strong>Task Owner Fqdn – </strong>If this is an enterprise pool, this states which front end owns the address book task.&#160; This is the machine that should be checked for event logs for address book replication.</p>  <p><strong>Backup Fqdn</strong> – Unfortunately due to a bug this should be ignored.</p>  <p><strong>Indexed Object Count</strong> – This is the number of users searchable from this pool.</p>  <p><strong>Objects not indexed that should be</strong> – This should always be 0.&#160; If it is not 0, then there is a problem indexing some users.&#160; This is a good time to call support.</p>  <p><strong>Abandoned objects</strong> – This should also always be 0, but there are a few scenarios where non-zero numbers of acceptable.&#160; Proper understanding of this value and the previous one will require a future blog post.</p>  <p><strong>Normalization Failure Count – </strong>This is the number of users who had a number that failed to normalize.&#160; In Lync 2010 this information was provided by a text file on the file share.&#160; It is now available from Powershell, but I will explain more shortly.</p>  <p><strong>Normalization Failures</strong> – When requested, this will provide the users and fields that failed to normalize.</p>  <p><strong>Server Heartbeats</strong> – This provides information on the current status of all front ends in the pool.&#160; If a front end has not heartbeated for some time, the backend will consider it down and will not assign tasks to it.&#160; To view more information, do something similar to the following.</p>  <p><font face="Courier">PS C:\&gt; $a = Debug-CsAddressBookReplication     <br />PS C:\&gt; $a.ServerHearbeats</font></p>  <p><font face="Courier">Server&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Hearbeat&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Register&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Last Unregister     <br />------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; -------------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; -------------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ---------------      <br />SERVER.vdomain.com&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 10/10/2012 10:10:48 PM 10/3/2012 5:31:21 PM&#160;&#160; 1/1/0001 12:00:00 AM</font></p>  <p>So what can you determine from this information?&#160; This will verify that address book replication is up and running and where to look for event logs.&#160; The objects not indexed value is perhaps the most important.&#160; A non-zero number there indicates trouble.&#160; It means there are users that should be searchable but are not.</p>  <p>The output differs significantly with the –User parameter.&#160; This parameter accepts one of the following</p>  <ol>   <li>SIP address</li>    <li>Active Directory object guid</li>    <li>Mail</li>    <li>SamAccountName</li> </ol>  <p>It will search for the user in Active Directory and return results similar to the following.</p>  <p><font face="Courier">PS C:\&gt; Debug-CsAddressBookReplication -user sip:iggy@vdomain.com</font></p>  <p><font face="Courier">Pool Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : pool0.vdomain.com     <br />Replication State&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : NotTested      <br />Task Owner Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : SERVER.vdomain.com      <br />Backup Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : fakepool.vdomain.com      <br />Server Heartbeats&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : {Microsoft.Rtc.SyntheticTransactions.Activities.Database.AbServerHeartbe      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at}      <br />Indexed Object Count&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 122      <br />Objects not indexed that should be : 0      <br />Abandoned objects&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0      <br />User Guid&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 98fea012-915c-4545-9ccf-6d981fc1dcd1      <br />Distinguished Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : CN=iggy Flipopovich,CN=Users,DC=vdomain,DC=com      <br />Sip Address&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : sip:iggy@vdomain.com      <br />Attribute Values&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : {entryid=98fea012-915c-4545-9ccf-6d981fc1dcd1, sn=flipopovich,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; givenName=iggy, msRTCSIP-PrimaryUserAddress=iggy...}      <br />Is Indexed&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True      <br />Should Be Indexed&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True      <br />Is Processed&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True      <br />Normalization Succeeded&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : True      <br />Manager&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; :      <br />Normalization Failure Count&#160;&#160;&#160;&#160;&#160;&#160;&#160; : Not checked      <br />Normalization Failures&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; :</font></p>  <p>With the –User parameter the cmdlet provides the following additional information.</p>  <p><strong>User Guid</strong> – This is the guid of the object in Active Directory.</p>  <p><strong>Distinguished Name</strong> – The DN of the object in Active Directory.</p>  <p><strong>Sip Address</strong> – Should be obvious</p>  <p><strong>Is Indexed</strong> – If true, then the user is searchable.&#160; If false, other users will not be able to search for this user.&#160; Note that there are some users (those will attributes set specifying Address Book should ignore them) where false is the valid value.</p>  <p><strong>Should be Indexed</strong> – This indicates whether the user should be searchable.&#160; If this value is true and is indexed is false, then there is a problem.&#160; If this value is false but you expect the user to be searchable, then you have likely set some attribute for the user causing address book to ignore it or the user does not have a Sip address or phone number.</p>  <p><strong>Is Processed</strong> – Whether address book processed this user at all.&#160; If the user has a value indicating address book should ignore it, this will be false.</p>  <p><strong>Normalization succeeded</strong> – Whether the user has any phone numbers that failed to normalize.</p>  <p><strong>Manager</strong> – The distinguished name of the user’s manager, if set.</p>  <p><strong>Attribute Values</strong>&#160; - Key value pairs of the information we have for the user in the database.&#160; This is what is available for search for the user.&#160; To see them better, do something similar to the following.</p>  <p><font face="Courier">PS C:\&gt; $a = Debug-CsAddressBookReplication -User sip:iggy@vdomain.com     <br />PS C:\&gt; $a.AttributeValues</font></p>  <p><font face="Courier">Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Value     <br />----&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; -----      <br />entryid&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 98fea012-915c-4545-9ccf-6d981fc1dcd1      <br />sn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; flipopovich      <br />givenName&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iggy      <br />msRTCSIP-PrimaryUserAddress&#160;&#160;&#160; iggy      <br />displayName&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iggy flipopovich      <br />msRTCSIP-PrimaryUserAddress&#160;&#160;&#160; iggy@vdomain.com      <br />msRTCSIP-PrimaryUserAddress&#160;&#160;&#160; sip:iggy@vdomain.com</font></p>  <p>The following other parameters are useful.</p>  <p><strong>DomainController </strong>– Specifies the DC to use instead of the default.</p>  <p><strong>PoolFqdn</strong> – Specifies the pool to examine instead of the one the current machine belongs to.</p>  <p><strong>VerifyNormalization – </strong>This will provide information about all users in the database that failed to normalize.&#160; It is a potentially expensive operation because it must pull apart binary blobs in the database to provide the information.&#160; Therefore it should not be run at mission critical times.&#160; The following is an example of its use.</p>  <p><font face="Courier">PS C:\&gt; Debug-CsAddressBookReplication -VerifyNormalization</font></p>  <p><font face="Courier">Normalization failures     <br />Return information on users that failed to normalize.      <br />[Y] Yes&#160; [N] No&#160; [S] Suspend&#160; [?] Help (default is &quot;Y&quot;): Y</font></p>  <p><font face="Courier">Pool Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : pool0.vdomain.com     <br />Replication State&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : NotTested      <br />Task Owner Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : SERVER.vdomain.com      <br />Backup Fqdn&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : fakepool.vdomain.com      <br />Server Heartbeats&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : {Microsoft.Rtc.SyntheticTransactions.Activities.Database.AbServerHeartbe      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at}      <br />Indexed Object Count&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 122      <br />Objects not indexed that should be : 0      <br />Abandoned objects&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0      <br />Normalization Failure Count&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 40      <br />Normalization Failures&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : {orgSearchU3@vdomain.com(942e3b3d-e0f0-4dc2-b836-0193e075e49c)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; otherTelephone=288-2062 x8865,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU3@vdomain.com(942e3b3d-e0f0-4dc2-b836-0193e075e49c)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ipPhone=616-3862 x4841,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InetOUser@vdomain.com(5c49c430-df18-4e2a-8371-088c12c5a44a)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; telephoneNumber=708-1283 x7773,      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InetOUser@vdomain.com(5c49c430-df18-4e2a-8371-088c12c5a44a) ipPhone=+1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (441) 475-3351 EXT3825...}</font></p>  <p>To better view the normalization failures do something similar to the following.</p>  <p><font face="Courier">PS C:\&gt; $a = Debug-CsAddressBookReplication -VerifyNormalization</font></p>  <p><font face="Courier">Normalization failures     <br />Return information on users that failed to normalize.      <br />[Y] Yes&#160; [N] No&#160; [S] Suspend&#160; [?] Help (default is &quot;Y&quot;): y      <br />PS C:\&gt; $a.NormalizationFailures</font></p>  <p><font face="Courier">AttributeName&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AttributeValue&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SipAddress&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UserGuid     <br />-------------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --------------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ----------&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --------      <br />otherTelephone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 288-2062 x8865&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU3@vdomain.com&#160;&#160;&#160; 942e3b3d-e0f0-4dc2-b836...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 616-3862 x4841&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU3@vdomain.com&#160;&#160;&#160; 942e3b3d-e0f0-4dc2-b836...      <br />telephoneNumber&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 708-1283 x7773&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InetOUser@vdomain.com&#160;&#160;&#160;&#160;&#160; 5c49c430-df18-4e2a-8371...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; +1 (441) 475-3351 EXT3825&#160;&#160; InetOUser@vdomain.com&#160;&#160;&#160;&#160;&#160; 5c49c430-df18-4e2a-8371...      <br />telephoneNumber&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 700-8800 x0360&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Grp_manager2@vdomain.com&#160;&#160; f0ed5c70-c279-4955-956b...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 706-7007 x2837&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Grp_manager2@vdomain.com&#160;&#160; f0ed5c70-c279-4955-956b...      <br />telephoneNumber&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 707-8044 x0088&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MoveUserTest@vdomain.com&#160;&#160; f800e93d-945c-48f1-89e1...      <br />otherTelephone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 704-4374 x5370&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MoveUserTest@vdomain.com&#160;&#160; f800e93d-945c-48f1-89e1...      <br />telephoneNumber&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 170-6181 x7880&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU1@vdomain.com&#160;&#160;&#160; 590e071a-8e4a-41d9-8522...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; +1 (022) 152-4752 EXT5172&#160;&#160; orgSearchU1@vdomain.com&#160;&#160;&#160; 590e071a-8e4a-41d9-8522...      <br />otherTelephone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 318-1125 x1133&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU16@vdomain.com&#160;&#160; 9ef32825-2a4b-4d97-b17b...      <br />otherTelephone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 463-4133 x2783&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; abwsTenantTester@user&#160;&#160;&#160;&#160;&#160; 77b2b3f3-302c-44b8-a12a...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 705-4041 x6023&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; abwsTenantTester@user&#160;&#160;&#160;&#160;&#160; 77b2b3f3-302c-44b8-a12a...      <br />otherTelephone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; +1 (520) 125-4267 EXT5563&#160;&#160; orgSearchU15@vdomain.com&#160;&#160; 5dbb9fbe-c026-40ae-bbcb...      <br />telephoneNumber&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 157-1563 x4363&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vt1_user66NT@vdomain.com&#160;&#160; 872d2a5b-48ea-4159-b016...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 705-5734 x5503&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vt1_user66NT@vdomain.com&#160;&#160; 872d2a5b-48ea-4159-b016...      <br />otherTelephone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 708-5235 x8175&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU6@vdomain.com&#160;&#160;&#160; 4d545448-8059-4ec4-8415...      <br />ipPhone&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 704-8184 x3017&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; orgSearchU6@vdomain.com&#160;&#160;&#160; 4d545448-8059-4ec4-8415...      <br />telephoneNumber&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; +1 (445) 577-7031 EXT0542&#160;&#160; orgSearchU5@vdomain.com&#160;&#160;&#160; 1fcc7136-9715-4dab-b811...</font></p>  <p>As you can see, this will provide the specific attribute, value, Sip address and user guid in Active Directory for the problem accounts.</p>  <p><strong>VerifyReplication</strong> – This will do the following for a user.</p>  <ol>   <li>Append a value to the sn in Active Directory</li>    <li>Wait for replication to occur</li>    <li>Verify the new sn appears in the database</li>    <li>Changes the sn back to the previous value</li> </ol>  <p>For most of you, this is most useful for obtaining logs to send to support as this forces replication for one user – making the logs far easier to read.&#160; For most other purposes you should use Update-CsAddressBook.</p>  <p><strong>-Verbose</strong> – Similar to all other cmdlets, this provides more information in the console.&#160; Some may prefer the output here to that above.</p>  <p>While certainly our hope is you will never need to use this cmdlet, it is there to provide useful information that can help you better understand what is happening when a user fails to appear within search results.</p>]]></content:encoded>
    </item>
    <item>
      <title>Address Book changes for Lync 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/address-book-changes-for-lync-2013</link>
      <pubDate>Tue, 02 Oct 2012 15:06:23 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/10/02/address-book-changes-for-lync-2013/</guid>
      <description><![CDATA[For those of you familiar with the address book from previous versions of Lync, you will find the...]]></description>
      <content:encoded><![CDATA[<p>For those of you familiar with the address book from previous versions of Lync, you will find the address book feature in Lync 2013 very familiar.&nbsp; On the outside we have made very few changes.&nbsp; The Powershell cmdlets used to manage the address book are essentially the same (with one change that I will mention soon) and the Soap interfaces to call it remain unchanged.&nbsp; Nevertheless address book has undergone dramatic changes in this wave.&nbsp; Before I began discussing the changes, let's rehash how ABS worked in Lync 2010.</p>
<p>In Lync 2010, address book required two databases - named rtcab and rtcab1.&nbsp; At any time one of these databases is active and one is being rebuilt.&nbsp; The active database is used to satisfy queries.&nbsp; Every day (usually at night) a sync process makes the inactive partition active and rebuilds the now inactive partition.&nbsp; This may lead to delays from the time a user is present in Active Directory and can sign in to when the user is searchable in the address book.</p>
<p>Let us now turn our attention to where this sync process (running as ABServer.exe on one of the front ends) obtains its data.&nbsp; It reads its data from the rtc database, which is populated by user replicator (running within RtcSrv.exe).&nbsp; Whenever a change is detected in Active Directory, user replicator writes the change to the AbUserEntry table in the rtc database and once a day ABServer.exe reads the entire contents of this table and rebuilds one of the rtcab databases.</p>
<p>As you can see, this process is not overly efficient.&nbsp; From the time a user is replicated to Active Directory to when the user is searchable could be as long as two days (if the user is entered right after a sync process begins).&nbsp; Therefore our primary goal for this release was to fix this.</p>
<p>The improvement is quite simple in description but far more complicated in implementation.&nbsp; User replicator now writes the data directly to rtcab.&nbsp; Address book data is no longer stored in rtc in the interim and rtcab1 is no longer used.&nbsp; Instead rtcab is updated with changes from Active Directory at the same time it responds to queries.&nbsp; This required rewriting most of address book to fit into user replicator, which is native code as compared to ABServer.exe which is managed.</p>
<p>From an administration perspective there is little change.&nbsp; We still handle normalization files exactly the same and the Powershell cmdlets work very similarly.&nbsp; The only change lies in the cmdlets Update-CsUserDatabase and Update-CsAddressBook.</p>
<p>In Lync 2010, it was necessary to first run Update-CsUserDatabase to force user replicator to completely populated the rtc database and then run Update-CsAddressBook to trigger a sync run.&nbsp; In Lync 2013 it is no longer necessary to call Update-CsUserDatabase for this purpose.&nbsp; In fact for address book this cmdlet will be a noop.&nbsp; We have subtly changed Update-CsAddressBook to trigger user replicator to update address book data.</p>
<p>Although feature wise we have not improved address book, this is really a major update.</p>]]></content:encoded>
    </item>
    <item>
      <title>Partitioning Lync Address Book using msRTCSIP-GroupingID</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/partitioning-lync-address-book-using-msrtcsip-groupingid</link>
      <pubDate>Thu, 07 Jun 2012 16:06:14 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/06/07/partitioning-lync-address-book-using-msrtcsip-groupingid/</guid>
      <description><![CDATA[In certain large organizations, the need exists to not allow certain users to search for...]]></description>
      <content:encoded><![CDATA[<p>In certain large organizations, the need exists to not allow certain users to search for others.&#160; One simple example of this is a school district.&#160; Perhaps the school district wants to only allow users within schools to search for each other.&#160; So if I belong to Cougar Hill Elementary I can search for my fellow teachers there, but I cannot search for users at Tiger Hill Elementary.</p>  <p>Partitioning users in this way is supported using a little known AD attribute called msRTCSIP-GroupingID.&#160; Before I explain this further, however, I would like to mention that this does not prevent users from <em>communicating</em> with each other, it simply prevents them from finding each other using the address book.&#160; Therefore, while I cannot look up another teacher at Tiger Hill Elementary if I am not in the same grouping, I can call or IM the teacher if I know the Sip address or phone number (though I will not be able to see the user’s photo).</p>  <p>The basic premise is you can define groups of users in your organizations and assign them different groupingIds.&#160; A groupingId is simply a guid and only users who have the same groupingId may search for each other.&#160; To set the groupingId for a user, you must set the value of msRTCSIP-GroupingId in Active Directory.</p>  <p>Unfortunately this is slightly tricky as we do not expose this attribute anywhere in our UI, nor do we expose it in Powershell.&#160; The best way to set this, therefore, is to make use of Active Directory’s Powershell module.</p>  <p><font size="2" face="Courier New">import-module ActiveDirectory</font></p>  <p>To select your users, you may use either Get-CsUser or Get-AdUser.&#160; If you choose to use Get-CsUser, there is a simple way to convert between them.</p>  <p><font size="2" face="Courier New">$myuser = Get-CsUser </font><a href="mailto:myuser@mydomain.com"><font size="2" face="Courier New">myuser@mydomain.com</font></a></p>  <p><font size="2" face="Courier New">Get-AdUser $myuser.Identity.DistinguishedName –Properties * | get-member</font></p>  <p>This will show all of the properties in Active Directory for the user <a href="mailto:myuser@mydomain.com">myuser@mydomain.com</a>.&#160; To work on multiple users at a time you may pipe the results.</p>  <p><font size="2" face="Courier New">Get-CsUser | foreach {Get-AdUser $_.Identity.DistinguishedName}</font></p>  <p>Though I certainly would not run the above command on most servers due to the result set size.&#160; To set the value of groupingId, the following will work.</p>  <p><font size="2" face="Courier New">$guid = [guid].NewGuid()</font></p>  <p><font size="2" face="Courier New">$myuser = Get-CsUser </font><a href="mailto:myuser@mydomain.com"><font size="2" face="Courier New">myuser@mydomain.com</font></a></p>  <p><font size="2" face="Courier New">Set-AdUser $myuser.Identity.DistinguishedName –Replace @{“msRTCSIP-GroupingID”=$guid}</font></p>  <p>Again, you can either create a script to do this for all the necessary users, or you can pipe the output.&#160; Just make sure all users you want to be able to see each other in the address book have the same groupingId. </p>]]></content:encoded>
    </item>
    <item>
      <title>How to enable last name, first searches in Lync Address Book</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/how-to-enable-last-name-first-searches-in-lync-address-book</link>
      <pubDate>Wed, 06 Jun 2012 14:35:00 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/06/06/how-to-enable-last-name-first-searches-in-lync-address-book/</guid>
      <description><![CDATA[Over time, a few people have asked me why, given someone with a first name of Ziggy and a last name...]]></description>
      <content:encoded><![CDATA[<p>Over time, a few people have asked me why, given someone with a first name of Ziggy and a last name of Zooga, you will see the following results when searching using the Lync Address Book.</p>
<p>Ziggy &ndash; <span style="color: #008000;" color="#008000">success</span></p>
<p><span style="color: #000000;" color="#000000">Zooga &ndash; </span><span style="color: #008000;" color="#008000">success</span></p>
<p><span style="color: #008000;" color="#008000"><span style="color: #000000;" color="#000000">Ziggy Zooga &ndash; </span>success</span></p>
<p><span style="color: #008000;" color="#008000"><span style="color: #000000;" color="#000000">Zooga Ziggy &ndash; </span></span><span style="color: #ff0000;" color="#ff0000">failure</span></p>
<p><span style="color: #000000;" color="#000000">Shouldn&rsquo;t we be able to find this when searching?&nbsp; Alas, this is not the way things work.&nbsp; However, there is a way to fix this.</span></p>
<p><span style="color: #000000;" color="#000000">Now before I go into details I must first provide a disclaimer.&nbsp; This workaround uses a completely undocumented and unsupported feature.</span></p>
<p><span style="color: #000000;" color="#000000">That being said, let&rsquo;s get to the fun part.&nbsp; First, a bit of explanation on how we process attributes is necessary.&nbsp; When the address book processes an entry, it iterates through each attribute that it is interested in (which itself is configurable using a resource kit utility) and reads the value.&nbsp; It then may choose to break up the value.&nbsp; Some values, such as displayName, are just passed as is to the next step.&nbsp; A few attributes, however, are handled specially.&nbsp; One example of this is msRTCSIP-PrimaryUserAddress.&nbsp; Given a Sip address, we expect the following searches to be possible.</span></p>
<p><span style="color: #000000;" color="#000000">sip:ziggy@mydomain.com</span></p>
<p><span style="color: #000000;" color="#000000"><a href="mailto:ziggy@mydomain.com">ziggy@mydomain.com</a></span></p>
<p><span style="color: #000000;" color="#000000">ziggy</span></p>
<p><span style="color: #000000;" color="#000000">To do this, we use regular expressions to pull the value apart into the above pieces.</span></p>
<p><span style="color: #000000;" color="#000000">The finally piece involves using normalization rules to apply formatting to phone numbers.&nbsp; This is detailed in a number of other blogs.&nbsp; As you can guess, if there is a way to pull apart names, we may be able to use it to our advantage.</span></p>
<p><span style="color: #000000;" color="#000000">The way to do this is via a file called RtcAbAttributeIndexRules.xml.&nbsp; This file exists in the server\core directory on each front end and you will need to restart RtcSrv if you change it.&nbsp; The main reason for this is we never intended for you to need to change this file.</span></p>
<p><span style="color: #000000;" color="#000000">If you open this file, you will see an attributes node at the top and a charDigitMaps node towards the bottom.&nbsp; In this post, I will only cover the attributes node.&nbsp; Each of the attributes under the attributes node tells us how to pull apart a particular attribute.&nbsp; Most of these are &ldquo;as-is&rdquo; or in other words we change nothing.</span></p>
<p><span style="font-family: Courier New; font-size: xx-small;" face="Courier New" size="1">&lt;attribute name="sn"&gt; <br />&nbsp; &lt;indexRules&gt; <br />&nbsp;&nbsp;&nbsp; &lt;indexRule id="sn_rule_01"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Index sn as-is <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[^.*$]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValues&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[$0]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValues&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/indexRule&gt; <br />&nbsp; &lt;/indexRules&gt; <br />&lt;/attribute&gt;</span></p>
<p>You can see that the regular expression for valuePattern will match anything passed in.&nbsp; The index value, in turn, says to use the entire match (group 0) so the result is the string is unchanged.&nbsp; Now compare this to what we do for the Sip address.</p>
<p><span style="font-family: Courier New; font-size: xx-small;" face="Courier New" size="1">&lt;attribute name="msRTCSIP-PrimaryUserAddress"&gt; <br />&nbsp; &lt;indexRules&gt; <br />&nbsp;&nbsp;&nbsp; &lt;indexRule id="msRTCSIP-PrimaryUserAddress_rule_01"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Index msRTCSIP-PrimaryUserAddress as-is <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[^.*$]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValues&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[$0]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValues&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/indexRule&gt; <br />&nbsp;&nbsp;&nbsp; &lt;indexRule id="msRTCSIP-PrimaryUserAddress_rule_02"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "sip:user@domain.com" =&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "user" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "user@domain.com" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[(\w+)\:(.+)@(.+)]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValues&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[$2]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[$2@$3]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValues&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/indexRule&gt; <br />&nbsp; &lt;/indexRules&gt; <br />&lt;/attribute&gt;</span></p>
<p>Here we index the value of msRTCSIP-PrimaryUserAddress as is, but we have another index rule that has a regular expression to remove the sip: (or whatever precedes the colon) from the address.&nbsp; We then reference the regular expression groups (the sip: is group 1) to add values without the protocol and without the domain.</p>
<p>If you think this may work for last name, first name searches, you would be partially correct.&nbsp; This will work, but is a limited solution.&nbsp; First I will explain the solution, then I will discuss its limitations.&nbsp; The following is one way to handle displayName.</p>
<p><span style="font-family: Courier New; font-size: xx-small;" face="Courier New" size="1">&lt;attribute name="displayName"&gt; <br />&nbsp; &lt;indexRules&gt; <br />&nbsp;&nbsp;&nbsp; &lt;indexRule id="displayName_rule_01"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Index displayName as-is <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[^.*$]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValues&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[$0]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValues&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/indexRule&gt; <br />&nbsp;&nbsp;&nbsp; &lt;indexRule id="displayName_rule_02"&gt; <br />&nbsp;&nbsp;&nbsp; &lt;description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Handle last name first name searches <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]]&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/description&gt; <br />&nbsp;&nbsp;&nbsp; &lt;valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[(.+)(\s+)(.+)]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/valuePattern&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValues&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[$3 $1]]&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValue&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/indexValues&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/indexRule&gt; <br />&nbsp; &lt;/indexRules&gt; <br />&lt;/attribute&gt;</span></p>
<p>Here, you can see that we are simply looking for one or more white space characters between the names and reversing it.&nbsp; There is no need to add an index for [$1 $3] because the first index rule will cover that.&nbsp; If you try this out, you will see that &ldquo;Zooga Ziggy&rdquo; is now searchable.</p>
<p>Of course, there are limitations to this approach.&nbsp; Besides the pain of setting this on every front end and restarting the service there, the solution is limited by the following.</p>
<p>1) This will obviously only work for two names.&nbsp; You can, of course, create additional rules for three and four names, but at some point a user will simply have too many names.</p>
<p>2) This approach will not work for languages that do not use spaces.&nbsp; In particular Chinese and Thai have this issue and the solution will not work there.</p>
<p>Nevertheless, this solution can be used to improve searches in your organization, even if it does not cover every name.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to create a new group and add contacts to it in UCMA</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/how-to-create-a-new-group-and-add-contacts-to-it-in-ucma</link>
      <pubDate>Mon, 04 Jun 2012 17:07:38 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/06/04/how-to-create-a-new-group-and-add-contacts-to-it-in-ucma/</guid>
      <description><![CDATA[It is quite easy to add groups, add contacts, and enumerate both contacts and groups using UCMA’s...]]></description>
      <content:encoded><![CDATA[<p>It is quite easy to add groups, add contacts, and enumerate both contacts and groups using UCMA’s ContactGroupServices extension.&#160; </p>  <p>To enumerate groups, you can use the following.</p>  <p>ICollection&lt;Group&gt; groups = endpoint.ContactGroupServices.EndGetAllGroups(endpoint.ContactGroupServices.BeginGetAllGroups(null, null));</p>  <p>To add a group, the following will work.</p>  <p>endpoint.ContactGroupServices.EndAddGroup(endpoint.ContactGroupServices.BeginAddGroup(“mygroupname”, null, null, null));</p>  <p>And to add a contact in this new group you may use the following.</p>  <p>ContactAddOptions contactOptions = new ContactAddOptions();    <br />contactOptions.GroupIds.Add(groupId);</p>  <p>// Add the contact    <br />endpoint.ContactGroupServices.EndAddContact(endpoint.ContactGroupServices.BeginAddContact(contactUri, contactOptions, null, null));</p>  <p>Where it becomes slightly confusing is, how do you obtain the groupId?&#160; At first glance, you may think the answer is to add the group, call GetAllGroups to retrieve the groups, find your new group, and use its groupId.&#160; Unfortunately, that is not the way to do it.</p>  <p>The problem is you really do not know when the group will actually be added, and until it is actually added the group will not have a groupId – so GetAllGroups will not return it.</p>  <p>The answer is therefore to subscribe for notifications and wait for the group to be created.&#160; Here is some sample code demonstrating this.</p>  <p>int groupId = 0;</p>  <p>AutoResetEvent foundGroupIdEvent = new AutoResetEvent(false);    <br />EventHandler&lt;ContactGroupNotificationEventArgs&gt; contactNotificationHandler =     <br />&#160;&#160;&#160; delegate(object sender, ContactGroupNotificationEventArgs e)     <br />&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach (NotificationItem&lt;Group&gt; groupNotification in e.Groups)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (String.Equals(“mygroup”, groupNotification.Item.Name, StringComparison.InvariantCultureIgnoreCase))     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; groupId = groupNotification.Item.GroupId;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foundGroupIdEvent.Set();     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160; };</p>  <p>endpoint.ContactGroupServices.NotificationReceived += contactNotificationHandler;    <br />endpoint.ContactGroupServices.EndAddGroup(endpoint.ContactGroupServices.BeginAddGroup(&quot;mygroup&quot;, null, null, null));     <br />foundGroupIdEvent.WaitOne(WaitTimeForGroupIdInSeconds * 1000, true);     <br />endpoint.ContactGroupServices.NotificationReceived -= contactNotificationHandler;</p>]]></content:encoded>
    </item>
    <item>
      <title>Sending a SUBSCRIBE message with headers</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/sending-a-subscribe-message-with-headers</link>
      <pubDate>Fri, 01 Jun 2012 10:42:02 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/06/01/sending-a-subscribe-message-with-headers/</guid>
      <description><![CDATA[UCMA makes it quite easy to send a subscribe message and then add, remove, or retrieve contacts...]]></description>
      <content:encoded><![CDATA[<p></p>  <p class="MsoNormal">UCMA makes it quite easy to send a subscribe message and then add, remove, or retrieve contacts and groups.   <p></p> </p>  <p class="MsoNormal"><span style="background: white; color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">endpoint.ContactGroupServices.EndSubscribe(endpoint.ContactGroupServices.BeginSubscribe(</span><span style="background: white; color: blue; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">null</span><span style="background: white; color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">, </span><span style="background: white; color: blue; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">null</span><span style="background: white; color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">));</span><span style="color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt;">     <p></p>   </span></p>  <p class="MsoNormal">In general the ContactGroupServices object, accessible from the Microsoft.Rtc.Collaboration.ContactsGroups namespace, provides a number of useful methods that make it easy to work with contacts.   <p></p> </p>  <p class="MsoNormal">Recently, however, I came across the challenge that I needed to add a header to my SUBSCRIBE message.<span style="mso-spacerun: yes;">&#160;</span>Granted, this is not an extremely common scenario but there are a number of headers that have special meanings to Lync and I needed to add one of them.    <p></p> </p>  <p class="MsoNormal">Unfortunately, this is where ContactGroupServices loses its usefulness as it does not allow you to change the headers.<span style="mso-spacerun: yes;">&#160; </span>You will therefore need to move one level down to the Sip signaling level.<span style="mso-spacerun: yes;">&#160;</span>Fortunately, there is an object here that will help – SipSubscription.    <p></p> </p>  <p class="MsoNormal">This is a slightly confusing object to use, so I thought I would provide some clarification here.<span style="mso-spacerun: yes;">&#160; </span>The following is how you will send the SUBSCRIBE message.    <p></p> </p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SipSubscription</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> subscription = </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">new</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SipSubscription</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">(     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>endpoint.InnerEndpoint,      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>target,      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>MicrosoftRoamingContactEvent,      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>contactSubcriber);      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">try</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">{     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160; </span>subscription.EndSubscribe(subscription.BeginSubscribe(</span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">null</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">, </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">null</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">));     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">}     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">catch</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> (</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">Exception</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> ex)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">{     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// Do something slightly more advanced than crying</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">}</span><span style="color: black; font-family: consolas; font-size: 9.5pt;">     <p></p>   </span></p>  <p class="MsoNormal">Well, that isn’t so difficult.<span style="mso-spacerun: yes;">&#160; </span>But what are these parameters you are passing?<span style="mso-spacerun: yes;">&#160; </span>Well, first I am assuming the endpoint object you have is of type UserEndpoint.<span style="mso-spacerun: yes;">&#160; </span>Therefore, the first object is of typeRealTimeEndpoint, which is what the lower level Sip signaling layer uses for your endpoint .<span style="mso-spacerun: yes;">&#160; </span>This is easily obtainable using the InnerEndpoint property of UserEndpoint.    <p></p> </p>  <p class="MsoNormal">The second parameter is also not rocket science.<span style="mso-spacerun: yes;">&#160; </span>It is a RealTimeEndpoint indicating the target address.<span style="mso-spacerun: yes;">&#160; </span>If you are subscribing to yourself, the easiest way to obtain this is the following.    <p></p> </p>  <p class="MsoNormal"><span style="background: white; color: rgb(43, 145, 175); line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">RealTimeAddress</span><span style="background: white; color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> target = </span><span style="background: white; color: blue; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">new</span><span style="background: white; color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">RealTimeAddress</span><span style="background: white; color: black; line-height: 115%; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">(endpoint.OwnerUri);</span>    <p></p> </p>  <p class="MsoNormal">The third parameter is the event package name.<span style="mso-spacerun: yes;">&#160; </span>There are different event packages possible, but for simplicity sake I will just tell you that the one ContactGroupServicesuses is called “vnd-microsoft-roaming-contacts”.<span style="mso-spacerun: yes;">&#160; </span>So just pass this string for this case.<span style="mso-spacerun: yes;">&#160; </span>A Bing search will provide more information on this document as well as other event packages available.    <p></p> </p>  <p class="MsoNormal">The last parameter is where the fun begins.<span style="mso-spacerun: yes;">&#160; </span>This must be an instance of an object that implements the ISipSubscriptionProcessor interface.<span style="mso-spacerun: yes;">&#160; </span>This interface has the following methods.    <p></p> </p>  <p class="MsoNormal"><b style="mso-bidi-font-weight: normal;">GetExtensionHeaders</b>– If you guessed that this is where you need to add your headers, you would be correct.    <p></p> </p>  <p class="MsoNormal"><b style="mso-bidi-font-weight: normal;">GetMessageBody</b> –Typically you do not need to do much here for contacts.    <p></p> </p>  <p class="MsoNormal"><b style="mso-bidi-font-weight: normal;">ProcessErrorResponse</b>– If something bad happens, this is how UCMA will notify you.    <p></p> </p>  <p class="MsoNormal"><b style="mso-bidi-font-weight: normal;">ProcessNotification</b>– When contacts are returned, UCMA will call you here.<span style="mso-spacerun: yes;">&#160; </span>Unfortunately you will need to parse the xml returned to understand what happened – something that ContactGroupServicesnormally handles for you.    <p></p> </p>  <p class="MsoNormal"><b style="mso-bidi-font-weight: normal;">SubscriptionStateChanges</b>– Called each time your subscription changes.    <p></p> </p>  <p class="MsoNormal">This is not a difficult interface to implement, but the entire process is not overly straightforward.<span style="mso-spacerun: yes;">&#160; </span>The following is my simplified implementation of it.    <p></p> </p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">class</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">AddHeaderSubscriber</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> : </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">ISipSubscriptionProcessor</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">{     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">private</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">Exception</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> _exception;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">Exception</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> Exception     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">get</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> { </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">return</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> _exception; }     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">void</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> GetExtensionHeaders(</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SipSubscription</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">.</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">RequestType</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> requestType, </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">out</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> System.Collections.Generic.</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">IEnumerable</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&lt;</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SignalingHeader</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&gt; extensionHeaders)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// Add our header</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">List</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&lt;</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SignalingHeader</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&gt; headers = </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">new</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">List</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&lt;</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SignalingHeader</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&gt;();     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>headers.Add(</span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">new</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SignalingHeader</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">(</span><span style="background: white; color: maroon; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&quot;SUPPORTED&quot;</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">, </span><span style="background: white; color: maroon; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">&quot;levitation&quot;</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">));     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>extensionHeaders = headers;      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">void</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> GetMessageBody(</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SipSubscription</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">.</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">RequestType</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> requestType, </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">out</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> System.Net.Mime.</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">ContentType</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> contentType, </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">out</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">byte</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">[] messageBody)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>messageBody = </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">new</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">byte</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">[0];     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>contentType = </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">null</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">void</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> ProcessErrorResponse(</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SipResponseData</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> message)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>_exception = </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">new</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">Exception</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">(message.ResponseText);     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">void</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> ProcessNotification(</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SipMessageData</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> message)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// Process a contact if we dare</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p>&#160;</p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">void</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> SubscriptionStateChanged(</span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SubscriptionStateChangedEventArgs</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> eventArg)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">switch</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> (eventArg.NewState)     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">case</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SubscriptionSignalingState</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">.Subscribed:     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// We subscribed!</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">break</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">case</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SubscriptionSignalingState</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">.Subscribing:     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// We are thinking about it</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">break</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">case</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SubscriptionSignalingState</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">.Terminated:     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// I'll be back!</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">break</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">case</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"> </span><span style="background: white; color: rgb(43, 145, 175); font-family: consolas; font-size: 9.5pt; mso-highlight: white;">SubscriptionSignalingState</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">.WaitingForRetry:     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// Doo bee doo bee doo bee doo</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">break</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">default</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">:     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: green; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">// ignore other states</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="background: white; color: blue; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">break</span><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">;     <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal; margin-bottom: 0pt; text-autospace: ; mso-layout-grid-align: none;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}      <p></p>   </span></p>  <p style="line-height: normal;" class="MsoNormal"><span style="background: white; color: black; font-family: consolas; font-size: 9.5pt; mso-highlight: white;">}</span><span style="color: black; font-family: consolas; font-size: 9.5pt;">     <p></p>   </span></p>  <p class="MsoNormal">Note that it is entirely possible to use bothContactGroupServices and SipSubscription together, though I recommend unsubscribing from one first before using the other.<span style="mso-spacerun: yes;">&#160; </span>When possible it is always best to allowContactGroupServices to handle the bulk of the work.<span style="mso-spacerun: yes;">&#160; </span>To unsubscribe with SipSubscription, useBeginTerminate and EndTerminate.    </p>]]></content:encoded>
    </item>
    <item>
      <title>Why is UCMA telling me my session is not established when I add a contact?</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/why-is-ucma-telling-me-my-session-is-not-established-when-i-add-a-contact</link>
      <pubDate>Thu, 24 May 2012 16:22:29 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2012/05/24/why-is-ucma-telling-me-my-session-is-not-established-when-i-add-a-contact/</guid>
      <description><![CDATA[Recently I found myself in the situation where I need to add a contact to a user using UCMA...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Recently I found myself in the situation where I need to add a contact to a user using UCMA &nbsp;but did not care about what contacts currently existed.&nbsp; I did the standard plumbing to create a CollaborationPlatform and register the user, then added the contact with the following code.</span></span></p>
<p>userEndpoint.ContactGroupServices.EndAddContact(this.Subscriber.ContactGroupServices.BeginAddContact(contactUri, null, null));</p>
<p><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">To my surprise, this failed with the following error.</span></span></p>
<p><span style="font-size: small;" size="3">Failed to add contact: The operation can be performed only when the state of the session is established.</span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">I spent some time scratching my head over this one, double checking that my session indeed was established, until I gave up and used my privileges at MSFT to debug into UCMA itself to see what was going on.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The issue is we do not support adding a contact without a subscription.&nbsp; At first you may wonder why this is the case.&nbsp; &ldquo;But I don&rsquo;t care what the current contacts are!&rdquo; you may say.&nbsp; That may be true, but in order to publish a contact add request, we need a delta number so the server can sort out multiple requests.&nbsp; In order to receive this delta number you must subscribe.&nbsp; Fortunately, subscribing is quite easy &ndash; just use the BeginSubscribe and EndSubscribe methods on ContactGroupServices.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">So if you happen to see this message, rest assured that there is nothing wrong with the session for your endpoint; it is the subscription session we are complaining about.</span></span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Running UCMA 2.0 applications on Lync Server 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/running-ucma-2-0-applications-on-lync-server-2010</link>
      <pubDate>Thu, 23 Sep 2010 11:47:00 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2010/09/23/running-ucma-2-0-applications-on-lync-server-2010/</guid>
      <description><![CDATA[While the most ideal scenario is to only run UCMA 3.0 applications with Lync Server 2010, for many...]]></description>
      <content:encoded><![CDATA[<p>While the most ideal scenario is to only run UCMA 3.0 applications with Lync Server 2010, for many of you this is simply not possible.&nbsp; You may own an application that was written for UCMA 2.0 and you want to upgrade to Lync Server 2010, but the application has not yet been updated to UCMA 3.0.&nbsp; Likewise, you may want to continue running your UCMA 2.0 application on an Office Communications Server 2007 R2 front end but still want it to be accessible by users homed on a Lync Server 2010 front end.</p>
<p>These scenarios are all possible, but unfortunately the steps to configure them are rather confusing.&nbsp; In some respects, this is one area where you really need to follow the directions to the exact letter.&nbsp; Several steps may look rather peculiar but unfortunately must be run exactly as specified.</p>
<p><strong>A note about the UCMA 3.0 runtime</strong></p>
<p>Unfortunately, UCMA 3.0 and UCMA 2.0 cannot be setup on the same machine.&nbsp; This is a limitation caused by their dependencies and therefore when you plan a topology that contains both UCMA 2.0 and UCMA 3.0 applications, you must take this into account.&nbsp; If you have applications of both types, they must exist on separate machines.</p>
<p><strong>UCMA 2.0 on OCS 2007 coexisting with Lync Server 2010</strong></p>
<p>This is the most common scenario, and from here I will cover the typical lifetime of such an application.&nbsp; I will cover directly installing a UCMA 2.0 application on Lync Server 2010 at the end of this blog.</p>
<p>In this scenario, you have at least two pools.&nbsp; One pool has Lync Server 2010 and the other pool has OCS 2007 R2.&nbsp; If your application is not already installed on the OCS 2007 R2 pool, you can do so by running the ApplicationProvisioner tool that is used with OCS 2007 R2 or making the WMI changes yourself.&nbsp; This is the same setup procedure for any OCS 2007 R2 application.&nbsp; After you do this, there is one more step to take to enable it to coexist with Lync Server 2010.</p>
<p>You will need to run the Merge-CsLegacyTopology cmdlet.&nbsp; To use it, run the following</p>
<p>Merge-CsLegacyTopology -TopologyXmlFileName newtopology.xml<br />Publish-CsTopology -FileName newtopology.xml<br />Enable-CsTopology</p>
<p>&nbsp;</p>
<p>Merge-CsLegacyTopology reads information from WMI and the current Central Management Server topology and creates new entries for the OCS 2007 R2 servers not already in the topology.&nbsp; You then must publish this new topology document for the changes to take effect.&nbsp; The UCMA 2.0 application residing on the OCS 2007 R2 server will now interoperate with Lync Server 2010.</p>
<p><strong>Migrating a UCMA 2.0 application running on OCS 2007 R2 to Lync Server 2010</strong></p>
<p>So your application is happily coexisting now, when your boss informs you that you should retire the OCS 2007 R2 pool and only use Lync Server 2010.&nbsp; This means you will now need to migrate your application to Lync Server 2010.&nbsp; What is the best (only) way to do this?</p>
<p>When you ran Merge-CsLegacyTopology, it created a new trusted application pool for your application's server.&nbsp; This pool is similar to a Lync Server 2010 pool but has a lower version number.&nbsp; However, what really determines what version your application is running under is the version of the registrar that the trusted application pool depends on.&nbsp; Therefore, the first part of migration will be changing the registrar from the OCS 2007 R2 registrar to a Lync Server 2010 registrar.</p>
<p>To view the current registrar, run Get-CsTrustedApplicationPool {pool fqdn}.&nbsp; You will see the Registrar dependency listed.</p>
<p><img border="0" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/14/2133.getpool.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-40-14/2133.getpool.jpg" /></p>
<p>On your system, though, the version will be set to 4 instead of 5.&nbsp; OCS 2007 R2&nbsp;= Version 4, while Lync Server 2010 = Version 5.&nbsp; To see the registrar, run Get-CsService {registrar identity}.&nbsp; Alternatively you can use</p>
<p>$myserver = Get-CsTrustedApplicationPool {fqdn}<br />Get-CsService -Identity $myserver.Registrar</p>
<p><img border="0" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/40/14/6708.getregistrar.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-40-14/6708.getregistrar.jpg" /></p>
<p>&nbsp;Of course, your registrar will show a version of 4.&nbsp; You can view the available registrars using Get-CsService -Registrar.&nbsp; Once you have selected the registrar, you will need to run the following to change the registrar of the OCS 2007 R2 trusted application pool to a Lync Server 2010 registrar.</p>
<p>Set-CsTrustedApplicationPool {fqdn} -Registrar {identity of Lync Server 2010 registrar}</p>
<p>The interesting thing is normally Set-CsTrustedApplicationPool does not allow you to make any changes to an OCS 2007 R2 pool.&nbsp; To make changes to an OCS 2007 R2 pool, you must make the appropriate changes in WMI and then rerun Merge-CsLegacyTopology as shown above.&nbsp; However, this is the one exception to the rule and Lync Server will allow you to use this cmdlet for an OCS 2007 R2 pool if the only thing being changes is the registrar and the registrar is a Lync Server 2010 registrar.&nbsp; Note that this is a one way operation!&nbsp; It is not possible to change the registrar back to an OCS 2007 R2 registrar.</p>
<p>Once this step is complete, you are still not finished.&nbsp; You will need to change all contact objects so they work in Lync Server 2010.&nbsp; To do this, you will need to migrate them.&nbsp; The syntax for doing this is.</p>
<p>Move-CsApplicationEndpoint {endpoint identity} -TargetApplicationPool {pool fqdn} -Force</p>
<p>Yes, you need to move each endpoint to the pool where it is already homed.&nbsp; In addition, the Force flag is extremely important.&nbsp; Without it the move will not work and you will notice a DCOM error.&nbsp; Once you have 'moved' all of your contacts, your application is now running on Lync Server 2010 and you can safely retire the OCS 2007 R2 pool.</p>
<p>Also note that whenever you create a new contact, you will again need to 'move' it using this cmdlet.</p>
<p><strong>Migrating to a UCMA 3.0 application on Lync Server 2010</strong></p>
<p>Your application is happily chugging away on Lync Server when a few months later your boss comes in and mentions that a UCMA 3.0 version of your application has now been released!&nbsp; You now need to configurate the UCMA 3.0 application on Lync Server while making sure all contacts are preserved.&nbsp; Provisioning the UCMA 3.0 application on Lync Server is the easy part and I will leave that to the product documentation.&nbsp; Where things get tricky is the fact that only one application with the same applicationId can depend on a given registrar at one time.</p>
<p>What you will therefore have to do is set the legacy application's registrar to null first, then configure your UCMA 3.0 application on Lync Server.&nbsp; This means that a service outage in this scenario is unavoidable.&nbsp; To set the registrar to null, simply run.</p>
<p>Set-CsTrustedApplicationPool {pool fqdn} -Registrar $null</p>
<p>Once your UCMA 3.0 application is configured and the pool depends on the same registrar, you will need to run the following to again 'move' your contacts.</p>
<p>Move-CsApplicationEndpoint {identity] -TargetApplicationPool {fqdn} -Force</p>
<p>Again, the pool is the fully qualified domain name of the trusted application pool where the contacts reside.&nbsp; Again this is the exact same pool where they already reside and again the force flag is required.</p>
<p>Luckily, from here the ApplicationProvisioner tool or WMI changes are no longer required.&nbsp; You can now use New-CsTrustedApplicationEndpoint to create new endpoints for your application as it uses UCMA 3.0.</p>
<p><strong>Installing a UCMA 2.0 application on Lync Server 2010</strong></p>
<p>Now that we have gone through the above steps, you may be able to guess how one installs a UCMA 2.0 application on Lync Server.&nbsp; To do this, you need to first use the OCS 2007 R2 ApplicationProvisioner tool or WMI to provision your application exactly as you did in OCS 2007 R2.&nbsp; For the registrar though, you will use the Lync Server 2010 registrar.</p>
<p>The next step is to run Merge-CsTopology</p>
<p>Merge-CsLegacyTopology -TopologyXmlFileName newtopology.xml<br />Publish-CsTopology -FileName newtopology.xml<br />Enable-CsTopology</p>
<p>This will create the OCS 2007 R2&nbsp;version of the pool in your Lync Server topology.&nbsp; Even though you do not have an OCS 2007 R2 front end, as far as Lync Server is concerned this is still an OCS 2007 R2 pool.</p>
<p>Finally, you will need to 'move' your contacts.</p>
<p>Move-CsApplicationEndpoint {identity] -TargetApplicationPool {fqdn} -Force</p>
<p>In order to create new contacts for your application, you will need to continue using the ApplicationProvisioner tool and then run Move-CsApplicationEndpoint with the above parameters.&nbsp; You will not be able to use the *-TrustedApplicationEndpoint cmdlets because they will only work with UCMA 3.0 applications running on Lync Server.</p>]]></content:encoded>
    </item>
    <item>
      <title>The Complexity of Simple Urls</title>
      <link>https://docs.microsoft.com/archive/blogs/jcalev/the-complexity-of-simple-urls</link>
      <pubDate>Wed, 22 Sep 2010 17:28:00 GMT</pubDate>
      <dc:creator><![CDATA[jscalev]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jcalev/2010/09/22/the-complexity-of-simple-urls/</guid>
      <description><![CDATA[One of the many new features in Lync Server 2010 is a change to how meeting Urls are...]]></description>
      <content:encoded><![CDATA[<p>One of the many new features in Lync Server 2010 is a change to how meeting Urls are formatted.&nbsp; The name of this feature is "Simple Url", but in truth this this elicits a smirk from anyone on our team who has dealt with them, as simple Urls are anything but simple.&nbsp; The goal of this blog will be to shed some light on this rather confusing topic.</p>
<p><b>What is a Simple Url?</b></p>
<p>In Offices Communications Server 2007, when you send someone a meeting invite, the Url is formatted similar to the following.</p>
<p><a href="https://cwa.contoso.com/join?uri=sip%3Aadon%40microsoft.com%3Bgruu%3Bopaque%3Dapp%3Aconf%3Afocus%3Aid%3A3814A82809A34ED0958CFDB60957BDF&amp;key=923089">https://cwa.contoso.com/join?uri=sip%3Aadon%40microsoft.com%3Bgruu%3Bopaque%3Dapp%3Aconf%3Afocus%3Aid%3A3814A82809A34ED0958CFDB60957BDF&amp;key=923089</a></p>
<p>This isn't exactly easy to remember and if you needed to transcribe it to someone it would take a few minutes.&nbsp; One of the goals in Lync Server 2010 was to make these Urls much easier - hence the name "simple" Url.&nbsp; Now, Url's look similar to the following.</p>
<p><a href="https://meet.contoso.com/071200">https://meet.contoso.com/071200</a></p>
<p>This is a lot easier, right?&nbsp; The only drawback here is these Urls must now be configured.&nbsp; To configure these Urls, you must create simple Urls.</p>
<p><b>So how can I create a simple Url?</b></p>
<p>There are two options for creating simple Urls.&nbsp; You can either use the topology builder or you can use Powershell to create simple Urls.&nbsp; It is also possible to view the existing simple Urls in the Lync Server Control Panel, but simple Urls cannot be changed there.&nbsp; This blog will cover managing simple Urls in Powershell.</p>
<p>The primary cmdlets used for creating simpleUrls are.</p>
<p>Get-CsSimpleUrlConfiguration</p>
<p>New-CsSimpleUrlEntry</p>
<p>New-CsSimpleUrl</p>
<p>The following is an example on creating a new Simple Url.</p>
<p>$newUrlEntry = New-CsSimpleUrlEntry -Url "https://meet.vdomain.com"</p>
<p>$newUrl = New-CsSimpleUrl -Component "meet" -Domain "vdomain.com" -SimpleUrl $newUrlEntry -ActiveUrl "https://meet.vdomain.com"</p>
<p>Set-CsSimpleUrlConfiguration Global -SimpleUrl @{Add=$newUrl}</p>
<p>Each simple Url can contain multiple entries, but only one can be active.&nbsp; The ActiveUrl property determines which Url is active.&nbsp; In order to properly understand the other two parameters, I need to explain a bit more.</p>
<p><b>Sipdomains and Simple Urls</b></p>
<p>Within the topology document multiple Sip domains can be specified.&nbsp; Sip domains specify which domain names are valid for users, contacts, and other endpoints.&nbsp; All users must end with a valid Sip domain.&nbsp; For instance, if you have a user, <a href="mailto:john@contoso.com">john@contoso.com</a>, a SipDomain for contoso.com must exist in the topology.&nbsp; If you have another user <a href="mailto:jack@marketing.contoso.com">jack@marketing.contoso.com</a>, the Sip domain marketing.contoso.com must also exist in the topology.</p>
<p>To view the existing Sip domains, use Get-CsSipDomain.&nbsp; To create a new Sip domain use New-CsSipDomain.&nbsp; Of all Sip domains, one domain is marked as the default and is used for creating new endpoints.</p>
<p>The domain parameter passed to New-CsSimpleUrl must be an existing SipDomain.&nbsp; Why is this necessary?&nbsp; As it happens, Sip domains and simple Urls are partners in crime.&nbsp; Neither can exist without the other.</p>
<p>When a user creates a conference, Lync Server examines the domain for that user and finds the corresponding simple Url.&nbsp; This is the simple Url where domain = {domain of the user}.&nbsp; The ActiveUrl of this simple Url is then used to create the meeting.&nbsp; Therefore, in order for the user to schedule online meetings a corresponding simple Url must exist.</p>
<p><b>Types of Simple Urls</b></p>
<p>There are actually three types of simple Urls.&nbsp; The one we have been discussing here is the "meet" type - specified by the Component parameter in New-CsSimpleUrl.&nbsp; The meet type is used for online meetings.&nbsp; There are also two other types.</p>
<p>Dialin - This is the Url to use for all dialin users.&nbsp; Note that the domain for a dialin simple Url must always be "*".</p>
<p>Admin - This allows one to create an easier Url for the Lync Server Control Panel.</p>
<p><b>After you have created your simple Urls</b></p>
<p>After you have created your simple Urls, you are still not finished.&nbsp; You must still create DNS A records for each of these simple Urls and you must run Enable-CsComputer on each machine that runs the web services role. </p>
<p>When Enable-CsComputer is run on each computer, it modifies the IIS service on each machine to contain the appropriate mappings for each Url.&nbsp; This is how simple Urls work.</p>
<p><b>Simple Urls and wildcards</b></p>
<p>In Office Communications Server 2007, it was possible to create allowed domains (the equivalent to Lync Server Sip domains) that contained a wildcard or simply specify that all domains are allowed.&nbsp; For instance, instead of creating entries for marketing.contoso.com and sales.contoso.com, one could create a single allowed domain *.contoso.com.</p>
<p>Unfortunately, due to the interdependence of simple Urls and Sip domains in Lync Server 2010 and the fact that simple Urls do not work with these schemes, we had to remove these features in Lync Server.&nbsp; Therefore, you must now specify all domains that are allowed and wildcards will not work.&nbsp; In cases where you have a large number of domains, it is possible to create many simple Urls and Sip domains using Powershell scripting.</p>
<p><b>SimpleUrlConfiguration and scope</b></p>
<p>As already stated, Get-CsSimpleUrlConfiguration returns a Central Management Server document that contains all configuration info for simple Urls.&nbsp; This document can be of global or site scope.&nbsp; For the vast majority of cases, you should only use the global scope.&nbsp; This means that this document will apply regardless where the user is homed.</p>
<p>However, there are some cases where users in a wide geographical area may share the same Sip domain, but you would prefer to minimize traffic that goes across.&nbsp; For instance, imagine that you have two sites - one in North Carolina and the other in Latvia.&nbsp; Users in both sites have the same Sip domain - contoso.com.&nbsp; In this case you could create two documents and scope them to each site.</p>
<p>New-CsSimpleUrlConfiguration Site:"North Carolina" -<i>other params</i></p>
<p>New-CsSimpleUrlConfiguration Site:Latvia -<i>other params</i></p>
<p>When determining the meeting Url, Lync Server will read the document for the site on which the user is homed.&nbsp; Note that <i>Set-CsSimpleUrlConfiguration Site:Latvia</i> will not work unless <i>New-CsSimpleUrlConfiguration Site:Latvia</i> has already been run.</p>
<p><b>Requirements of a simple Url</b></p>
<p>The following are requirements for all simple Urls.</p>
<ul>
<li>- Left prefix simple Urls are not allowed. For instance the following two simple Urls would not be allowed because one is a subset of the other.</li>
</ul>
<p><a href="https://meet.contoso.com/">https://meet.contoso.com</a>/meet</p>
<p><a href="https://meet.contoso.com/meet/me">https://meet.contoso.com/meet/me</a></p>
<ul>
<li>- Must begin with https:// (http is not allowed)</li>
<li>- Must have a corresponding Sip domain (see above)</li>
<li>- Cannot be empty</li>
<li>- Cannot be the same as a computer or pool Fqdn in the topology</li>
<li>- Cannot contain a query string parameter. A Url of the format <a href="https://meet.contoso.com/meet.htm?type">https://meet.contoso.com/meet.htm?type</a>=foo is not allowed.</li>
<li>- Must be a valid fully qualified domain name</li>
</ul>
<p>Also note that we will automatically add a trailing / to the Url.&nbsp; Therefore if you create a Url <a href="https://meet.contoso.com/default.htm">https://meet.contoso.com/default.htm</a> we will change this to <a href="https://meet.contoso.com/default.htm/">https://meet.contoso.com/default.htm/</a>. </p>
<p><b>Interaction between Powershell and the Topology Builder</b></p>
<p>As already mentioned, it is possible to create simple Urls using either Powershell or the topology builder.&nbsp; However, it is generally unwise to mix these together when creating a single batch of simple Urls.&nbsp; The behavior between the two is slightly different.</p>
<p>When using Powershell, if one creates a Sip domain, Lync Server will not create the corresponding simple Url.&nbsp; This must be accomplished separately.&nbsp; After all, how would the cmdlet know which Url to use?</p>
<p>The Topology Builder, however, will create a simple Url for each Sip domain.&nbsp; These Sip domains can then be edited using the Topology Builder and when you publish the topology, both the simple Urls and Sip domains will take effect at the same time. </p>
<p>One strange side effect though is if one creates the Sip domain using Powershell, then opens the Topology Builder and loads the topology, it will appear that the simple Urls were automatically created.&nbsp; This is sort of the case.&nbsp; The topology builder will notice that Sip domains exist for which no corresponding simple Urls exist and will create new simple Url entries that can be changed in the Topology Builder, but these changes will not take effect until the topology is published.</p>
<p><b>Conclusion</b></p>
<p>Simple Urls in practice may be simple for users, but they are far from simple for administrators.&nbsp; Most important is the relationship between simple Urls and Sip domains.&nbsp; Once these concepts are understood managing them is much easier. </p>]]></content:encoded>
    </item>
  </channel>
</rss>