Lync/SfB: How to change Persistent Chat Privacy Web Form

Recently we were asked to disable the Open Room creation in Persistent Chat. The purpose was to only allow users to create Private or Closed Rooms from the website.

pchatwebprivacy01

After some research we didn’t find any setting/policy that could disable or remove that option.

The only option was to try to find in the web pages if there was anything we could change. It turns out that the easiest way is to change the JavaScripts for Persistent Chat Room Management webpages. These are located in:

Internal Website- C:\Program Files\Microsoft Lync Server 2013\Web Components\PersistentChat\Int\RM\JScripts

External Website – C:\Program Files\Microsoft Lync Server 2013\Web Components\PersistentChat\Ext\RM\JScripts

pchatwebprivacy02

We need to change the RoomForm.js file. In this file look for the function MainForm.prototype.cleanUpRoomPage:

pchatwebprivacy03

The radio button is radOpen, so we simply disable it. For this we need to add the following line:

this.radOpen.disabled = true;

pchatwebprivacy04

Note: You need to change it in all relevant servers and also in both Internal and External Websites.

Since we changed the JavaScript, there’s no need to recycle the application pool or execute iisreset.

Now reload the page and the Open radio button should be grayed out:

pchatwebprivacy05

Note: This will also change the form for the creation and editing of a Room.

Advertisements
Tagged with: , , ,
Posted in Lync Server, Skype4B

Lync 2013 won’t change to Skype4B when deployed using OCT

We found out that there is a scenario where the icon isn’t changed to Skype for Business after the April 2015 update.

skype4bicon01

The Start Menu shortcut was also Lync 2013:

skype4bicon02

While troubleshooting the issue, we discovered that the C:\Windows\Installer\{91150000-0011-0000-1000-0000000FF1CE}\ folder contained two different files with Lync and Skype4B icons:

skype4bicon03

After testing it, we discovered that the root cause for this issue was due to Lync 2013 being installed with a customized shortcut using Office Customization Tool (OCT):

skype4bicon04

There are 3 known workarounds, the first two will require redeploy but they are permanent. The last workaround is temporary and an update or repair will revert the changes made by the script.

1) Redeploy Office 2013 using OCT

If we don’t change the shortcut location in OCT, we will only get the lyncicon.exe in the Windows Installer folder. Also, this issue happens with Office 2013 and Lync 2013 Standalone.

2) Redeploy Office 2013 using config.xml

A good alternative to OCT is to use a config.xml in order to customize the installation, but with this method, however, we cannot change the shortcut location:

Config.xml file reference for Office 2013
https://technet.microsoft.com/en-us/library/cc179195.aspx

3) Run a script after every update

The final workaround is to use a script after every client update that will change the icons files. As an example here are the PowerShell cmdlets (requires elevated permissions) to change the icon and description:

$shortcutLocation = “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Office 2013\”
$oldShortcut = “Lync 2013.lnk”
$newShortcut = “Skype for Business 2015.lnk”
$iconComment = “Connect with people everywhere through voice and video calls, Skype Meetings, and IM.”

# Create a copy of the Shortcut:
Rename-Item $shortcutLocation$oldShortcut $newShortcut

# Change the new shortcut settings
$shell = New-Object -COM WScript.Shell
$shortcut = $shell.CreateShortcut($shortcutLocation+$newShortcut)
$shortcut.Description = $iconcomment
$shortcut.Save()

#Get the Icon Name and Folder
$iconlocation = $shortcut.IconLocation
$tempInd = $iconlocation.indexof(“Icon”)

$iconName = $iconlocation.substring($tempInd,$iconlocation.indexof(“.exe”)-$tempInd )
$iconFolder = $iconlocation.substring(0,$tempInd)

#Change the icon:
Rename-Item $iconFolder$iconName”.exe” $iconFolder$iconName”_old.exe”
Copy-Item  $iconFolder”lyncicon.exe” $iconFolder$iconName”.exe”  -force

skype4bicon05

Now we have the Skype for Business 2015 icon:

skype4bicon06

And also the Skype for Business 2015 shortcut in the Start Menu:

skype4bicon07

Tagged with: , ,
Posted in Lync Server, Skype4B

Changing back to Lync 2013 Icon after the April 2015 update

Some of us were surprised by the Lync 2013/Skype for Business Client update, since this security update also included the Skype4B User Interface. Lync/Skype4B administrators could still use the recently added EnableSkypeUI setting to the Client Policy in order to manage which UI they want the user to see.

In our Lync Lab, we have it configured to False and the user is able to see the Lync 2013 UI. The icon, however, is still Skype for Business:

lyncicon01

As this can cause confusion in some users, the purpose of this article is to show a workaround to this. Keep in mind that future client updates will change the icon again.

In the Start Menu, we had this:

lyncicon02

The folder location is “%ProgramData%\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013”.

lyncicon03

Note: In our lab, the folder is C:\Windows\Installer\{90150000-0011-0000-0000-0000000FF1CE}, and we can check were the file is with this:

Get-ChildItem -Path C:\Windows\Installer -Filter lyncicon.exe -Recurse

lyncicon04

We need to get the icon before the update and copy it with the name lyncoldicon.exe to the same folder. Although we can copy it to another folder, it’s preferable to keep all icons in the same location:

lyncicon05

It’s a good practice to keep both icons because we may want to change back to Skype for Business icon.

In a PowerShell window with elevated permissions, we run the following cmdlets:

$shortcutLocation = “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013\”
$newShortcut = “Lync 2013.lnk”
$oldShortcut = “Skype for Business 2015.lnk”
$iconLocation = “C:\Windows\Installer\{90150000-0011-0000-0000-0000000FF1CE}\”
$iconComment = “Connect with people everywhere through voice and video calls, Lync Meetings, and IM.”

#Change the icon:
Rename-Item $iconLocation”lyncicon.exe” $iconLocation”skypeicon.exe”
Rename-Item  $iconLocation”lyncoldicon.exe” $iconLocation”lyncicon.exe” -force

# Create a copy of the Shortcut:
Rename-Item $shortcutLocation$oldShortcut $newShortcut

# Change the new shortcut settings
$shell = New-Object -COM WScript.Shell
$shortcut = $shell.CreateShortcut($shortcutLocation+$newShortcut)
$shortcut.Description = $iconcomment
$shortcut.Save()

lyncicon06a

Note: All scripts should be extensively tested before being applied in a production environment.

After running the cmdlets, the Start Menu should change to this:

lyncicon07

And after a reboot the icon will also change in the TaskBar:

lyncicon08

To rollback the changes:

$shortcutLocation = “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013\”
$oldShortcut = “Lync 2013.lnk”
$newShortcut = “Skype for Business 2015.lnk”
$iconLocation = “C:\Windows\Installer\{90150000-0011-0000-0000-0000000FF1CE}\”
$iconComment = “Connect with people everywhere through voice and video calls, Skype Meetings, and IM.”

#Change the icon:
Rename-Item $iconLocation”lyncicon.exe” $iconLocation”lyncoldicon.exe”
Rename-Item  $iconLocation”skypeicon.exe” $iconLocation”lyncicon.exe” -force

# Create a copy of the Shortcut:
Rename-Item $shortcutLocation$oldShortcut $newShortcut

# Change the new shortcut settings
$shell = New-Object -COM WScript.Shell
$shortcut = $shell.CreateShortcut($shortcutLocation+$newShortcut)
$shortcut.Description = $iconcomment
$shortcut.Save()

lyncicon09a

Tagged with: , ,
Posted in Lync Server, Skype4B

Lync Edge Server on a single subnet

The point of this post is to help those that can’t have 2 NIC on 2 separated not routable subnets. I have already encountered some customers whose security team stated that it was technically impossible to deploy an additional subnet on their current security/network infrastructure.

Many of you know that Lync Edge Requirements have the following statement:

The internal and external subnets must not be routable to each other.
In http://technet.microsoft.com/en-us/library/gg412847.aspx

To meet this requirement we need two subnets on our DMZ, as showed in the following example:

EdgeSN01

Since we can only have one default gateway, the routes to the internal address should look like this:

route ADD 10.0.0.0 MASK 255.255.255.0 172.20.0.254 METRIC 1
route ADD 10.1.0.0 MASK 255.255.255.0 172.20.0.254 METRIC 1
route ADD 10.2.0.0 MASK 255.255.255.0 172.20.0.254 METRIC 1

What about those deployments that only have one subnet for the Lync Edge Network Interfaces?

EdgeSN02

In this example, we have 2 interfaces with the same gateway. It’s common to create a route as in the previous example — although this can work in some cases, what can happen is that Lync Edge will use External NIC to reach internal address.
Firewall will block all communications from the external NIC to internal address. Also, Lync Front End isn’t expecting External NIC to reach it.
The workaround is to specify how Lync Edge NIC should be used to reach internal address. This can be achieved by following 2 simple steps:

Step 1 – Find Edge Internal interface number

Command Prompt

First we need to know the internal interface name:

ipconfig /all

EdgeSN03
Note: We already know that 172.16.0.30 is the internal interface IP address.

After getting the interface name, let’s get the Interface Index — 15 in this case:

route print -4

EdgeSN04

PowerShell (only in Windows Server 2012/2012R2)

The following Cmdlet — which is only available on Windows 8/8.1, Server 2012/2012R2 — displays the Interface Index more quickly than the Command Prompt method.

Get-NetIPAddress -AddressFamily IPv4 | Select ifIndex,IPAddress | ft -Autosize

EdgeSN05

Step 2 – Create the proper routes in the IP routing table

Now all we need to do is create the routes that specify the Interface Index:

Command Prompt

route ADD 10.0.0.0 MASK 255.255.255.0 172.16.0.254 METRIC 1 IF 15 -p
route ADD 10.1.0.0 MASK 255.255.255.0 172.16.0.254 METRIC 1 IF 15 -p
route ADD 10.2.0.0 MASK 255.255.255.0 172.16.0.254 METRIC 1 IF 15 -p

EdgeSN06

PowerShell (only in Windows Server 2012/2012R2)

New-NetRoute -AddressFamily IPv4 -DestinationPrefix “10.0.0.0/24” -NextHop 172.16.0.254 -RouteMetric 1 -ifIndex 15
New-NetRoute -AddressFamily IPv4 -DestinationPrefix “10.1.0.0/24” -NextHop 172.16.0.254 -RouteMetric 1 -ifIndex 15
New-NetRoute -AddressFamily IPv4 -DestinationPrefix “10.2.0.0/24” -NextHop 172.16.0.254 -RouteMetric 1 -ifIndex 15

EdgeSN07

After these changes, the Lync Edge will use internal NIC for all communications to the Front End(s) and Clients. Do remember this workaround should only be used if you can’t have 2 not routable subnets on Lync Edge Server.
TIP: If you want, you can create routes to all possible internal addresses, as long as your company follows what is described in RFC1918 regarding private IP address:

Command Prompt

route ADD 10.0.0.0 MASK 255.0.0.0 172.16.0.254 METRIC 1 IF 15 -p
route ADD 172.16.0.0 MASK 255.240.0.0 172.16.0.254 METRIC 1 IF 15 -p
route ADD 192.168.0.0 MASK 255.255.0.0 172.16.0.254 METRIC 1 IF 15 -p

PowerShell (only in Windows Server 2012/2012R2)

New-NetRoute -AddressFamily IPv4 -DestinationPrefix “10.0.0.0/8” -NextHop 172.16.0.254 -RouteMetric 1 -ifIndex 15
New-NetRoute -AddressFamily IPv4 -DestinationPrefix “172.16.0.0/12” -NextHop 172.16.0.254 -RouteMetric 1 -ifIndex 15
New-NetRoute -AddressFamily IPv4 -DestinationPrefix “192.168.0.0/16” -NextHop 172.16.0.254 -RouteMetric 1 -ifIndex 15

Tagged with: , , , ,
Posted in Lync Server, Skype4B