Run multiple instances of Skype for Business concurrently

Published: Tuesday, December 19 2017

How to run multiple instances of Skype for Business concurrently

Microsoft's Skype for Business (formerly named Lync and Communicator before that) is a great collaboration tool but unfortunately it doesn't support using multiple accounts (concurrently).

Launching a 2nd instance just activates the already running instance, and brings the main Window to the foreground. The behaviour is very similar to Google Earth on Citrix XenApp which I covered in a previous blog.

This is very inconvenient if you have more than one account, e.g. if you're an external consultant you likely have an account within your own organization and one in the customer's organization.

In my case, I have a work (Cloudhouse) account and an account for the Dutch Citrix User Group (DuCUG), as I am a member of the steering group.

I don't believe Microsoft is deliberately blocking running multiple instances, it just hasn't accounted for it.

The way developers detect if an application is already running is to use synchronization objects, typically this is a Mutex. To see which objects Skype for Business is using we can use API Monitor

API Monitor is a free software that lets you monitor and control API calls made by applications and services. Its a powerful tool for seeing how applications and services work or for tracking down problems that you have in your own applications.a

Once you've started API Monitor you can select which API calls you'd like to monitor. Since we are interested in sychronization objectes I have selected Event and Mutex from System Services -> Synchronization:

API Monitor | API Filter | System Services | Synchronization | Event | Mutex

Now we can launch Skype for Business via File | Monitor new Process

API Monitor | File | Monitor New Process | C:\Program Files (x86)\Microsoft Office\root\Office16\lync.exe

Press OK to launch Skype for Business and after the logon is complete we have a list of the required synchronization objects:

Next step is to create a container by capturing the Skype for Business installation with our Auto Packager and add the following lines to the MutexIsolation section of the Redirections.xml file:

<MutexIsolation>
   <MutexName>Local\MicrosoftOfficeCommunicatorSharedMemoryAccess</MutexName>
   <MutexName>Global\Office Communicator_</MutexName>
   <MutexName>Communicator-</MutexName>
</MutexIsolation>

Since I already have Skype for Business installed on my machine, I am going to leverage a lesser known feature of our redirection engine (AAV) which is to run a natively installed application and apply redirections to it.

This means that I can run Skype for Business with and without AAV (our redirection engine) concurrently, without installing it twice and without even creating a container!

To make sure we can use different settings (e.g. accounts) between the different Skype for Business instances we need to virtualize the folders and registry keys where Skype for Business writes it's settings.

Fortunately a Process Monitor trace and a quick look at the filesystem revealed that all required was 2 folders and 2 registry keys.

For the filesystem add this to the Redirections.xml:

<FileSystem>
   <FolderMatch>
      <From>%AppData%\Microsoft\Office\16.0\Lync</From>
      <To>%AppData%\Microsoft\Office\16.0\Lync2</To>
   </FolderMatch>
   <FolderMatch>
      <From>%LocalAppData%\Microsoft\Office\16.0\Lync</From>
      <To>%LocalAppData%\Microsoft\Office\16.0\Lync2</To>
   </FolderMatch>
</FileSystem>

This will redirect the Lync folder to Lync2 in both Local- and Roaming Application Data.

Next add these registry redirections to Redirections.xml:

<Registry>
   <VirtualRoot>HKCU\Software\Cloudhouse\AppAccelerator\SkypeForBusiness</VirtualRoot>
   <Redirects>
      <KeyMatch>
         <From>HKCU\Software\Microsoft\Office\16.0\Lync</From>
      </KeyMatch>
      <KeyMatch>
         <From>HKCU\Software\Microsoft\Office\16.0\Common\Identity</From>
      </KeyMatch>
   </Redirects>
</Registry>

Finally add the Skype for Business executable (lync.exe) to Programs.xml:

<Program>
   <RunCondition>run1</RunCondition>
   <ProcessWindowStyle>Normal</ProcessWindowStyle>
   <Path>%DefaultDir%\AppAcceleratorV.exe</Path>
   <Args>/f "C:\Program Files (x86)\Microsoft Office\root\Office16\lync.exe" %FILEARGS%</Args>
   <WorkingDirectory />
   <WaitCondition TimeoutInSeconds="0">None</WaitCondition>
</Program>

Now let's see this in action:

 

By Remko Weijnen, EUC Specialist

Tags: CitrixMicrosoftStore for BusinessUWP

Comments 4

  1. Tarek:
    Feb 21, 2018 at 04:29 PM

    Hi there, thanks for the nice Blog,

    Just quetion I trying to do this but I stuck at the point of redirection engine (AAV) how to find it

    Thanks for your feedback

  2. Somveer Balyan:
    Mar 29, 2018 at 10:16 AM

    Can you explain how to do this step?

    Next step is to create a container by capturing the Skype for Business installation with our Auto Packager and add the following lines to the MutexIsolation section of the Redirections.xml file:

  3. Daniel:
    Apr 12, 2018 at 08:37 AM

    Where the hell are all of those .xml files, because i can't find them anywhere

  4. Noah:
    Apr 18, 2018 at 03:10 PM

    Please help us configure the additional XML files. Where is the Auto Packager you mentioned? I really need this, and you are the only one on the net that seems knowledgeable enough about this to help outline a possible fix.






Allowed tags: <b><i><br>Add a new comment:


Tags for this Article:

Citrix Microsoft Store for Business UWP

Blog Links

With Cloudhouse, MSIX is for IT Pros Too!

Cloudhouse are pleased to announce support of Microsoft's new packaging format MSIX - announced as part of the Spring Creators Update. This blog covers the benefits of this new format, what it means for developers and how Cloudhouse enable IT Pros to make use of it immediately for their existing Win XP and 7 application estate. By Stu Moore, Head of Product

Evergreen IT

This blog explores Evergreen IT, and answers the following questions; What is Evergreen IT? Are organisations making the move to Evergreen? What about the OS? What is Microsoft’s solution to the Evergreen OS? What is the main challenge adopting Windows as-a-service? How to enable Evergreen applications?