Showing posts with label Lync. Show all posts
Showing posts with label Lync. Show all posts

Thursday, July 23, 2015

Cisco CME and Lync Simultaneous Ringing using Cisco SNR Feature

Cisco has a Single number reach feature that allows calls to ring more than one number. Think of it as a parallel hunt group but with the option to turn it off and on from the user's phone.

With this setup, the end user's Lync client and Cisco phone will ring a the same time.

Lync (Skype for Business) setup

Create PSTN Gateways
 - use the IP address of the CME

Create the Trunks
- Listening on port 5060 and Mediation port 5068.

Enable Enterprise Voice for user's account.

Assign a fake number to the Line URI in the user's account setup
(Example of user with extension 4025 would be Tel:+13065554025)

* You can also create a CME Dial Plan and a CME Voice Policy to allow Lync users to call out on the CME's phone lines from their Lync client.

Cisco CME setup

- If you are using Voice and Data Vlans on your CME, bind it to the CME same Vlan used by the Lync server.

interface GigabitEthernet0/0.1
 description Voice 
 encapsulation dot1Q 1
 ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet0/0.134
 description Data
 encapsulation dot1Q 2
 ip address 192.168.2.1 255.255.255.0

voice service voip
 sip
  bind control source-interface GigabitEthernet0/0.1
  bind media source-interface GigabitEthernet0/0.1


Create voice translation-rules (these will add the +1306 in front of the number)

voice translation-rule 8000
 rule 1 /^81306/ /+\11306/
 rule 2 /^810101306/ /+\11306/
 rule 3 /^8306/ /+\11306/
 rule 4 /^8/ /+\11306/

voice translation-profile Lync
 translate called 8000

Create dial-peer for Lync server, 8 followed by the 7 digit phone number. 

dial-peer voice 8000 voip 
description ** SIP 7 digit to Lync13-01 ** 
translation-profile outgoing Lync 
destination-pattern 8....... 
notify redirect ip2pots 
session protocol sipv2 
session target ipv4:192.168.2.10:5068 

voice-class sip bind control source-interface GigabitEthernet0/0.2
voice-class sip bind media source-interface GigabitEthernet0/0.2
session transport tcp 
dtmf-relay rtp-nte 
codec g711ulaw 
fax rate disable 
fax protocol pass-through g711ulaw 
no vad

SNR on SIP Phones  (Add these commands to the basic DN and Pool settings)

voice register dn 1 
number 4025 
mobility snr 85554025 
delay 0 timeout 12 cfwd-noan 1200 
snr ring-stop 
snr answer-too-soon 1
voice register pool 1
number 1 dn 1
session-transport tcp
dtmf-relay rtp-nte sip-notify

SNR on SCCP phones (Add these commands to the basis Ephone-dn and ephone settings)


ephone-dn 300 octo-line 
mobility 
snr calling-number local 
snr 85554025 delay 0 timeout 12 cfwd-noan 1200 
snr ring-stop 
snr answer-too-soon 1
ephone 1
button 1:300
See also - Cisco's Single Number Reach article


Thursday, April 2, 2015

Removing a Lync Contact using Powershell and XML


Back in February I posted about adding contacts to Lync Groups.
However, what happens when you spell the contact address wrong and you just imported that into your 1000+ clients contact list...

Well, you need to find a way to remove the contact from the XML file.
I could have restored the backup files to the user accounts... but didn't think of that until I got this solution working. *

After trying to create an XML script tath use the same script in the previous post, but this time we will replace the offending string with blanks.

Add this to the Configurable Variables section
#Delete this line from XML
$Variable = @'
<Contact Buddy="contact@domain.com" SubscribePresence="1" Groups="1 20" />
'@
$CommonContact = "contact@domain.com" # The one that is spelled wrong.

In the Process-Contacts Function,

Change If ($ContactsToAdd) to If ($ContactsToAdd) 

Remove the $ContactsToAdd section and replace it with.

$DeleteRecord = (Get-Content "$WorkingFolder\DocItemSet.xml") |
    ForEach-Object {$_ -replace $Variable, ""} |
    Set-Content "$WorkingFolder\DocItemSet.xml"

* This does remove the contact from the user's visual list of contacts.  However, when the user's contact info is exported, the old contact is still there just not listed in any groups which is why it doesn't appear in the client.

In short, double check spelling and try it on a test account.

To change the script from all users to 1 users change...
$AllSipAddresses = Get-CsUser -Identity lyncroom@domain.com -Filter {Enabled -eq $True} | Select SipAddress | %{$_.SipAddress.Replace('sip:','')}

Original Post about adding groups found here on Roland Paix's IT Blog

More on the custom Lync rooms found here.

Friday, February 20, 2015

Bulk Import Custom Contact Groups into Lync User accounts

Was looking for a way to Populate our Lync Room systems into end users Lync Contacts as a group rather than a bunch of individual accounts.  (More on Lync Room Systems here http://bit.ly/netadmlr)

Based on the PowerShell script found below, a new section was created for the Contact Groups.
http://rp-it.blogspot.ca/2014/02/automatically-populate-contacts-for-all-lync-2013-users.html

Rather than repost the entire code, here's the updated sections...
For each Lync group that you want to create I would suggest creating new scripts.

For Individual account testing...

#Old version Enable for All users Disable for individual testing
$AllSipAddresses = Get-CsUser -Filter {Enabled -eq $True} | Select SipAddress | %{$_.SipAddress.Replace('sip:','')}

#GM Added - Enable for individual testing
#$AllSipAddresses = Get-CsUser -Identity lastname.first@domain.com -Filter {Enabled -eq $True} | Select SipAddress | %{$_.SipAddress.Replace('sip:','')}


# Common Contacts - Enable and populate this variable with a set of Lync contacts to distribute to all users instead of distributing all users to all users. Overrides $DontAddUsers.
#$CommonContacts = "lrs1@domain.com","lrs2@domain.com"

To add /verify the Group exists.
$AllContacts = @($SipAddressesToAdd | ?{$_ -ne $User})
    [xml]$XMLFile = Get-Content "$WorkingFolder\DocItemSet.xml"
    $XMLPart = $XMLFile.DocItemSet.DocItem | ?{$_.Name -like "urn:lcd:*"}
    $XMLNode = $XMLPart.Data.HomedResource.Contacts
$XMLNodeGroup = $XMLPart.Data.HomedResource.ContactGroups #GM
    $ExistingContacts = @($XMLNode.Contact | Select -ExpandProperty Buddy)
$ExistingContactGroups = @($XMLNodeGroup.ContactGroup | Select -ExpandProperty DisplayName) #GM
#GM Lync Rooms Contact Group Add
If($ExistingContactGroups){
If($ExistingContactGroups -eq "THluYyBSb29tcw=="){
write-host "`r`nLync Room Group Exists. Nothing changed.`r`n"
}
Else{
write-host "`r`nLync Room Group will be added.`r`n"
[System.XML.XMLLinkedNode]$NewContactGroup = $XMLFile.CreateElement('ContactGroup','http://schemas.microsoft.com/RtcServer/2002/11/dbimpexp')
            $NewContactGroup.SetAttribute('Number','20') #High number so as to not overwrite existing groups.
            $NewContactGroup.SetAttribute('DisplayName','CodeFromXML')
            #Display name in ContactGroups found in XMl file in test account
            #Export-CsUserData -PoolFqdn "lyncserver.domain.com" -UserFilter name@domain.com -FileName "c:\scripts\test.zip"
            $XMLNodeGroup.AppendChild($NewContactGroup)
        }
}
Else{
write-host "`r`nNo existing contact groups found.`r`n"
write-host "`r`nAdding New Contact Group XML Element.`r`n"
[System.XML.XMLLinkedNode]$NewNodeGroup = $XMLFile.CreateElement('ContactGroups','http://schemas.microsoft.com/RtcServer/2002/11/dbimpexp')
            [System.XML.XMLLinkedNode]$NewContactGroup = $XMLFile.CreateElement('ContactGroup','http://schemas.microsoft.com/RtcServer/2002/11/dbimpexp')
            $NewContactGroup.SetAttribute('Number','20') #High number so as to not overwrite existing groups.
            $NewContactGroup.SetAttribute('DisplayName','CodeFromXML')
            $NewNodeGroup.AppendChild($NewContactGroup)
            $XMLCGroup = $XMLPart.Data.HomedResource.Containers
            $XMLPart.Data.HomedResource.InsertBefore($NewNodeGroup,$XMLCGroup)
            $XMLFile.Save("$WorkingFolder\DocItemSet.xml")
            [xml]$XMLFile = Get-Content "$WorkingFolder\DocItemSet.xml"
            $XMLPart = $XMLFile.DocItemSet.DocItem | ?{$_.Name -like "urn:lcd:*"}
            $XMLNode = $XMLPart.Data.HomedResource.Contacts
}
#Back to original code
    Write-Host "`r`nExisting contacts:`r`n" 

Change these lines to include 1 and the group number in the $ContactstoAdd | foreach{} section
$NewContact.SetAttribute('Groups','1 20') 

If you have a large organization, you will need to create a new policy or edit the Global Presence policy.  Once all the Lync users had the Lync Rooms in the list, the "Maximum Followers Reached" error showed up on the Lync Room systems.

A new Presence Policy was created and applied to the Lync Room accounts. The MaxCategorySubcriptions was to 3000 and the error went away.

 Since it was only applied to the Lync Room systems it should not drastically increase the server traffic as compared to applying to all our Lync users.

Thursday, May 1, 2014

Custom Lync Room System Startup

Keep update on this project by following this link... http://bit.ly/netadmlr


To create the Domain joined custom Lync Room System...
  1. Group Policy to change these Registry Entries using Preferences
    1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon (Applied to Computer Settings)
      1. DefaultUserName - LyncRoomAccount
      2. DefaultPassword - LyncRoomAccount Password
      3. DefaultDomainName - Domain.ca
      4. AutoLogonCount - Deleted
      5. AutoLogonChecked - Deleted
    2. HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell to wscript.exe //NoLogo /I "C:\Program Files\Lync Room System\Lync Room Computer Startup.vbs"  (Applied to Lync Room User Account Preferences)
    3. By using Preferences you can apply the settings based on Computer Name or Account name.  This allows the computer to still be used as a regular Windows system when logged off.
  2. Lync Room Computer Startup.vbs 
    1. Uses these Sysinternals programs BGInfo, PSKill
      1. Copy the BGinfo program over to "Program Files\Background"
      2. Edit LRS.bgi to change the desktop text and jpg images.
    2. Starts Rainmeter program with "Lync Room System" skin
      1. Once you install the program and installed Lync Room Skin, you must copy the "Lync Room System" folder from your documents\Rainmeter folder to the "Lync Room System" folder.
    3. Runs Office 2013 Lync
The Source files can be found here.  Copy them over to "C:\Program Files\Lync Room System" once the programs have been installed.  Includes a MS Word document with Group Policy information for creating your own GPO.

Monday, April 28, 2014

Rainmeter Custom Desktop Skin

Keep update on this project by following this link... http://bit.ly/netadmlr


April 30, 2014
Changed from Images to Buttons (Changes Icon based on mouse action - hover/click)
 - Includes Paint.Net PDN files for you to change
Battery Skin
 - Changed "Charging" to "AC Power"

Future versions will include the option to disable Right mouse button by adding
RightMouseUpAction=[] at the top of each skin in the [Rainmeter] section.

April 29, 2014

Shutdown/Restart/Log Off Bug - You will have to change the Logoff.cmd and Restart.cmd commands to say shutdown.exe other wise it will run the shutdown.cmd file before the shutdown.exe file. 

April 28, 2014
Uploaded the Rainmeter skin for the Custom Lync Room system to DeviantArt

Requires Rainmeter 3.1 - http://rainmeter.net/

Latest version of the Lync Room System Rainmeter Skin
http://gmpentaxfan.deviantart.com/art/Lync-Room-System-Custom-Desktop-Rainmeter-Skin-450762970

This allows for desktop icons, date, time, battery level, speaker levels and custom application launching without "explorer.exe" running.

Added the Rainmeter.exe with custom rainmeter.ini to load this skin via the computer startup script.

See previous article... http://gmnetadmin.blogspot.ca/2014/04/custom-lync-room-system.html

Tuesday, April 15, 2014

Custom Lync Room System

Keep update on this project by following this link... http://bit.ly/netadmlr

This past month (April 2014) has been spent working on a custom Lync Room System solution that doesn't involve purchasing a Lync Room System.

Followed the Lync Room System deployment guide for the LRS account setup, but instead of the LRS special software/hardware...
It uses the Lync 2013 client and can be deployed to any Windows 7 computer.

Update - April 30, 2014 - Now using Rainmeter software to add Desktop icons, clock, volume control and battery level. http://gmnetadmin.blogspot.com/2014/04/rainmeter-custom-desktop-skin.html

Setting up the computer to Autologin with LRS account.


Custom Lync Room Startup Video

Detailed Setup for the Custom Lync Room System

Resource Links
Lync LRS Deployment guide - http://www.microsoft.com/en-us/download/details.aspx?id=39274

Automatic Login Windows 7 - http://superuser.com/questions/28647/how-do-i-enable-automatic-logon-in-windows-7-when-im-on-a-domain

Sysinternals - BGInfo program for custom wallpaper background - http://technet.microsoft.com/en-us/sysinternals/bb897557

Sysinternals - Suite - Used PSkill and PSExec programs - http://technet.microsoft.com/en-us/sysinternals/bb842062

Encode a Script - http://gallery.technet.microsoft.com/scriptcenter/16439c02-3296-4ec8-9134-6eb6fb599880/view/Reviews

Lync Custom Commands - http://msdn.microsoft.com/en-us/library/office/jj945535(v=office.15).aspx