Microsoft Lync Remove duplicate entries of Line URI Tel from Lync


Copy the below script and paste it into Notepad (or a Windows PowerShell editor) and save the file with the name Get-CsApplicationContact.ps1.
2. From a Microsoft Lync Front End server, open Lync Server Management Shell.
3. Navigate to the folder where the .ps1 file is located, and run the following command:
Import-Module .\Get-CsApplicationContact.ps1
4. Run the following command to retrieve the list of Response Group contact objects associated with a specific pool (pool01.contoso.com in the example below):
Get-CsApplicationContact –OwnerUrn "urn:application:Rgs" –Filter "(MSRTCSIP-ApplicationOptions=1)" –RegistrarPool "lync-pool.test.local"

The OwnerUrn parameter specifies that you want only contacts for the Response Group application. The Filter parameter is an LDAP filter that will select only contact objects that have been at some point tied to a Response Group workflow, and unselect the two contact objects (Presence Watcher and Announcement Service) that are automatically created with Response Group application. The RegistrarPool parameter allows you to select only contacts associated with a specific pool.
5. The preceding command should output all the properties of every contact object formerly associated with a Response Group workflow on the specified pool. If you are satisfied with that list, you can delete those contact objects by simply re-running the same command and adding the Delete parameter at the end, like this:
Get-CsApplicationContact –OwnerUrn "urn:application:Rgs" –Filter "(MSRTCSIP-ApplicationOptions=1)" –RegistrarPool "lync-pool.test.local" –Delete
You’ll receive a confirmation prompt to delete each contact object, so that you can skip some of them if necessary.

Microsoft Lync Configuration Lync Caller ID Supression


What if Option #1 won’t work for you? Your gateway guy doesn’t want to do it, your PBX guy doesn’t want to do it, your PBX can’t do it, etc… Well, Lync 2010, again, provides a new option which previously didn’t exist in Office Communications Server 2007 or Office Communications Server 2007 R2.
In order to do to do this, we will need to create 3 new things:
  1. Lync Voice Policy
  2. Lync Phone Usages
  3. Lync Voice Routes
By itself, Phone Usages don’t do anything. They are only the secret sauce that links a Voice Policy to a Route. If we take a look at our Lync Route, we can see the new option for Supressing Caller ID with a specific phone number. In this case, let’s assume +13125556666 is our main office DID.

In the above screenshot, we can also see that we have an Associated PSTN usage record of Non-DID. We also have a Voice Policy assigned called Non-DID users. For our DID users, they will be in a different Voice Policy that utilizes a Voice Route that does not have Supress Caller ID enabled.
If you decide to use this configuration, any non-DID users will have their FROM: field modified to +13125556666 once they are moved into the Non-DID Users Voice Policy. Their SIP Invite message will now look this:
INVITE sip:+18002223333@lyncgateway.internalAD.domain.com;user=phone SIP/2.0
FROM: “Test, Elan”;epid=AA4B5C1773;tag=d57257363e
TO:

So with Option #2, we will end up with the following:
DID Users
  • DID Voice Policy
  • DID Phone Usage assigned to DID Voice Policy
  • DID Phone Usage assigned to DID Voice Route with no Caller ID Suppression linking the DID Users to the DID Voice Routes
Non-DID Users
  • Non-DID Voice Policy
  • Non-DID Phone Usage assigned to the Non-DID Voice Policy
  • Non-DID Phone Usage assigned to the DID Voice Route with Caller ID Suppression linking the Non-DID Users tot he Non-DID Voice Routes

Microsoft Lync Lync Address Book Normalization



Default the MS Lync cliĆ«nt uses the Telephone numbers from Active Directory. If this number isn’t build-up using the E.164 format it isn’t shown if you view the contact card in the Lync client. There are two resolutions for that problem:
1. Update AD using the E.164 format.
2. Use an corporate normalization rule
I will explain option 2 because option 1 isn’t an option in many companies.
Configuring Address Book Normalization
By default normalization is already enabled in Lync Server which can be verified by the viewing the Lync Server’s current Address Book configuration.
  • From the Lync Server Management Shell execute the cmdlet Get-CsAddressBookConfiguration and note that the UseNormalizationRules value should already be set to True.

But this setting in and of itself does nothing yet as the normalization file needs to be configured first. Just as with OCS the Address Book does not leverage any Enterprise Voice normalization patterns which may have been created to support EV calling. Note that if the value is set to ‘False’ (Set-CsAddressBook –UseNormalizationRules $false) then even numbers already entered in +E.164 format will not appear in the Lync client.
  • Locate the Lync Server’s shared directory which was configured during the initial server deployment. The file server FQDN and share name can be identified in the Topology Builder under File Stores.

  • Browse to the share directory on the server and locate the ABFiles subdirectory.
\\SERVERNAME\Share\1-WebServices-1\ABFiles
  • Create a new text file named Company_Phone_Number_Normalization_Rules.txt in the ABFiles directory. This normalization rules file must be stored in this location and not down a few directories where the actual address book files are stored as it was in OCS.

  • Edit the file with Notepad and enter the following example normalization and translation patterns. This rule will apply to the users configured with phone numbers in this standard 10-digit format: (312) 555-7500. (The first three lines are commented out and are not required in the text file.)
##
## Normalize 10-digit phone number patterns from Active Directory into +E.164
##
(\d{10})
+1$1
Up until this point anyone familiar with Office Communications Server should recognize that everything is about the same, other than the required location of the normalization text file. An improvement in Lync Server’s address book normalization process is instantly noticeable when looking at the simplicity of the example pattern above. In the past long, complicated regular expressions (regex) were required to filter-out any non-digit information which could be potentially stored in the telephone field.
But now Lync Server automatically ignores non-telephony related digits in the strings and only looks at the continuous 0-9 numerical digits (and also recognizes the + symbol). So there is no longer a need to include regex code like [\s()\-\./]* in patterns to ignore spaces, parenthesis, dashes, etc.
  • Execute Update-CsAddressBook to import the new settings configured in the text file and apply them to numbers stored in the address book files.
PS C:\> Update-CsAddressBook
  • After 5 minutes have elapsed force an address book update on the Lync client

At this point the contacts previously not displaying phone number information should now be working.