Teams: Check client version using PowerShell

An easy way to check MS Teams version is in the client by going to About > Version:

The version will be displayed near the Command Box:

The MS Teams client is installed per user and the version is stored in the settings.json file:

%AppData%\Microsoft\Teams\

Using PowerShell we can convert JSON files to PowerShell Objects:

PowerTip: Convert JSON File to PowerShell Object
https://blogs.technet.microsoft.com/heyscriptingguy/2014/04/23/powertip-convert-json-file-to-powershell-object/

Now we can run the following PowerShell cmdlet to get the Teams client version:

Get-Content $env:UserProfile”\AppData\Roaming\Microsoft\Teams\settings.json” | ConvertFrom-Json | Select Version, Ring, Environment

The install/update date is in the installTime.txt file in the same folder:

Get-Content $env:UserProfile”\AppData\Roaming\Microsoft\Teams\installTime.txt”

Note: The date is stored in MM/dd/yyyy

Since MS Teams is installed on a user level we can have multiple versions on the same machine.

To check all the installed versions we can use a PowerShell Script that will execute the previous cmdlets for each user.

The script is available in TechNet Gallery and doesn’t take any parameter:

MS Teams installed version for each user profile
https://gallery.technet.microsoft.com/MS-Teams-Get-installed-60c0dc5c

Get-TeamsVersion.ps1

Thanks to The Scripting Guys for a way to list the user profile paths:

Use PowerShell to Find User Profiles on a Computer
https://blogs.technet.microsoft.com/heyscriptingguy/2011/11/10/use-powershell-to-find-user-profiles-on-a-computer/

Lync/SfB: Check client version using PowerShell

During troubleshooting we often need to check the installed version, for Lync/SfB Server we already know how to check the installed version using PowerShell:

Skype for Business Server Component Version using Get-CsServerPatchVersion

Skype for Business Server 2015 Component Version using PowerShell

Lync Server Component Version using PowerShell (Windows Registry)

On the client we can check the version by using going to Option > Help > About:

However, for the SfB 2016 MSI this is a slightly different since the displayed version is the MSO component and not the SfB client version:

To get the Lync/SfB client version we can simply run the following in PowerShell cmdlet:

(Get-ItemProperty -path “HKLM:\Software\Microsoft\Windows\CurrentVersion\App Paths\lync.exe”).”(Default)” | ForEach-Object {Get-ChildItem -Path $_ | Select-Object -ExpandProperty VersionInfo | Select FileDescription,ProductVersion} | ft -autosize

Skype for Business 2016 MSI

Skype for Business 2016 Click-to-Run

Skype for Business 2015 MSI

Please note that this will work for Lync2013/SfB2015/SfB2016 Click-to-Run or MSI versions.

For Lync 2010 and previous client versions we need to modify from lync.exe to communicator.exe:

(Get-ItemProperty -path “HKLM:\Software\Microsoft\Windows\CurrentVersion\App Paths\communicator.exe”).”(Default)” | ForEach-Object {Get-ChildItem -Path $_ | Select-Object -ExpandProperty VersionInfo | Select FileDescription,ProductVersion} | ft -autosize

Lync/SfB Server: Stop Front End service in Starting state

Some of the cases we work have the Front End service in a Starting state:

In PowerShell the status is StartPending:

We cannot stop it on the Services Management Console:

We can go to Task Manager and try to manual stop the service:

If that doesn’t work we need to Go to Details and End task that is associated with the service:

Another simple way to stop all Starting services is by using the following PowerShell cmdlet. We will get a prompt for each service:

Get-Service | ?{$_.Status -eq “StartPending”} | Stop-process

Get-Service
https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.management/get-service

Stop-Process
https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.management/stop-process

SfB Server Component Version using Get-CsServerPatchVersion

The recent November 2015 Cumulative Update for Skype for Business Server 2015 added the Get-CsServerPatchVersion to the available PowerShell cmdlets.

This new PowerShell cmdlet replaces the previous methods (Windows Registry and WMI Classes). To get the Skype4B Server Component Version:

Skype for Business Server 2015 Component Version using PowerShell

We need to make sure that the Skype for Business Server 2015 is running, at least, the November 2015 Cumulative Update (6.0.9319.102) and then simply run:

Get-CsServerPatchVersion | ft -AutoSize

Note: Using “| ft -AutoSize” will allow to read the full ComponentName column. Without it we will get:

We can still use the previous methods, but it’s easier to type Get-CsServerPatchVersion instead of:

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | ?{$_.DisplayName -like “*Skype for Business Server*”} | Sort-Object DisplayName | Select DisplayName, DisplayVersion, InstallDate | Format-Table -AutoSize

Or:

Get-WmiObject -query ‘select name, version from win32_product’ | where {$_.name -like “*Skype for Business Server*”} | Sort-Object Name | Select Name, Version | ft -AutoSize

Hyper-V: Configure VLAN Trunk on Kemp LoadMaster

One of the Load Balancers that we have in our lab is LoadMaster from Kemp Technologies. We already published an article on how to deploy it:

UC Lobby: Deploying Kemp Technologies Free LoadMaster as Lab Load Balancer/Reverse Proxy

Why do we need to enable VLAN Trunk? The reason for this is that our lab “router” reached the maximum number of Virtual network adapters that we can add in Hyper-V (8 network adapters + 4 legacy network adapters):

Hyper-V scalability in Windows Server 2012 and Windows Server 2012 R2
https://technet.microsoft.com/en-us/library/jj680093.aspx

By enabling VLAN Trunk on the Network Adapter we can bypass that limitation.

In this post, we show you how to enable VLAN Trunk in Hyper-V and configure Kemp LoadMaster. Note that the steps in Hyper-V can also be used for other types of Virtual Machines.

To change the adapter mode to Trunk we need to use PowerShell on the Physical Host. The Network Adapters associated to a Virtual Machine can be listed by running:

Get-VMNetworkAdapter -VMname “LB01” | Select VMName, SwitchName | ft -AutoSize
https://technet.microsoft.com/en-us/library/hh848526(v=wps.630).aspx

So, we know that we want to change the mode to Trunk on the Network Adapter connected to “Gears”. Also, we specifically want to leave VLAN 0 as default and enable two VLANs in the Trunk:

Get-VMNetworkAdapter -VMname “LB01” | ?{$_.switchname -eq “Gears”} | Set-VMNetworkAdapterVlan -Trunk -NativeVlanId 0 -AllowedVlanIdList “1301,1302”


Note: The Default VLAN will be automatically added to the allowed list.

Set-VMNetworkAdapterVlan
https://technet.microsoft.com/en-us/library/hh848475(v=wps.630).aspx

Now that we have enabled VLAN Trunk, the next step takes us to the Kemp LoadMaster Web Management interface. In System Configuration > Network Setup > Interfaces > eth1 — this being the interface in which we want to configure the different VLANs —, we need to click on VLAN Configuration:

In the next screen, we specify the VLAN ID:

After adding the VLAN, a new drop-down list will be added to System Configuration > Interfaces:

 

By selecting the VLAN we can configure the IP address:

We can now ping the above-mentioned interface:

Finally, the Virtual Services status will show as “Up”:

PSScript: Lync/SfB Server Certification Store Validation

In a previous post, we published the checks/validations that we should do in the Certification Store in the Lync/SfB servers.

Checks to do in the Lync/SfB Certificate Store

We decided to write a PowerShell with all these checks to make it simple to use. The script will be kept in sync with the post, meaning that when a new check is added, it will also be included in the script.

The PowerShell script is available in the TechNet Gallery:

Lync/Skype4B Certification Store Validation
https://gallery.technet.microsoft.com/LyncSkype4B-Certification-c80a7143

Both script usage and change log are included in the TechNet Gallery description.

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