Tuesday, August 20, 2013

Publish Outlook in Citrix with Lync Online Meeting but have Lync hidden

We have users that want to use Outlook but not Lync but do want the ability to make calls directly from Outlook to the user.  We have tried using UISuppressionMode but when that is launched through Citrix "communicator.exe" starts for a second then closes.  In my brief research it appears this is because communicator.exe is looking to be configured and utilized in a programatic way.  I was able to create a PowerShell script using the Lync 2010 SDK to launch Lync in this UI minimized way but the Outlook Lync plugin's would not communicate to the UISuppressed Lync.  This is the powershell script I bulit to do that:

#Importing SDK Dll
[string]$LyncModelDll = "C:\Program Files (x86)\Microsoft Lync\SDK\Assemblies\Desktop\Microsoft.Lync.Model.dll"
Import-Module -Name $LyncModelDll

START .\communicator.exe

#Get Lync Client State
$objLyncClient = [Microsoft.Lync.Model.LyncClient]::GetClient()
Write-Host = "State: " $objLyncClient.State

$objLyncClient.BeginInitialize($test,$null)
$objLyncClient.BeginSignIn($objLyncClient.Uri,$null,$null,$null,$null)

In the end I opted for an AutoIT script that starts Lync then hides the window and the taskbar icon.

;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x/NT
; Author:         Trentent Tye (trententtye@hotmail.com)
;
; Script Function:
;   Opens Lync in a hidden window and hides the tray icon.
;
#Include

Run("C:\Program Files (x86)\Microsoft Lync\communicator.exe", "", @SW_HIDE) ; 

WinWaitActive("Microsoft Lync")
Opt("WinTitleMatchMode", 4)
Global $hTray = WinGetHandle("[CLASS:Shell_TrayWnd]")
Global $hToolbar = ControlGetHandle($hTray, "", "[CLASSNN:ToolbarWindow321]")
Global $iCnt = _GUICtrlToolbar_ButtonCount($hToolbar)
;MsgBox(0, "Debug" , "Debug: $iCnt = " & $iCnt)
Global $iCmdVolume = -1
Global $sMsg, $sText, $iCmd
For $n = 0 To $iCnt - 1
    $sMsg = "Index: " & $n 
    $iCmd = _GUICtrlToolbar_IndexToCommand($hToolbar, $n)
    $sMsg &= "  CommandID: " & $iCmd
    $sText = _GUICtrlToolbar_GetButtonText($hToolbar, $iCmd)
    If StringInStr($sText, "Lync") Then $iCmdLync = $iCmd
    $sMsg &= "  Text: " & $sText
;    MsgBox(0, "Debug" , $sMsg)
Next
;MsgBox(0, "Debug","Debug: $iCmdLync = " & $iCmdLync)

_GUICtrlToolbar_SetButtonState($hToolbar, $iCmdLync, $TBSTATE_HIDDEN)


3 comments:

Anonymous said...

Hi there, I am trying your autoit script for Lync 2013, however it is not hiding itself and I the script is not closing. I am running it on a TS server running 2008R2. What do I need to modify in the script?

Thanks for you help.

Trentent said...

I have only used it against 2010. I'm not sure if it will work for 2013. Sorry.

Sam Wonder said...

ezTalks is the world's leading online video conferencing provider that enables you to connect with people anywhere and anytime. Integrated with HD video conferencing, audio conferencing, screen sharing, content sharing, remote control and other powerful features, it can be widely applied to all industries
join.me competitors
telecommuting advantages
open source meeting software