UPDATE: Run the following from an elevated Windows PowerShell session to resolve this issue:

Skype for Business 2015

powershell.exe –noexit –command “cd $env:UserProfile; Import-Module ‘C:\Program Files\Common Files\Skype for Business Server 2015\Modules\SkypeForBusiness\SkypeForBusiness.psd1’”

Lync 2013

powershell.exe –noexit –command “cd $env:UserProfile; Import-Module ‘C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1’”


The last few days I’ve been working on getting Lync deployed into my Hyper-V lab, on Server 2012 R2

After deploying the usual prerequisites and Lync 2013 Core Components, I noticed something unusual. I was unable to get a prompt from the Lync Management Shell CLI:

1

Looking closer at the shortcut installed on the Start Menu (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Lync Server 2013), I noticed that a closing quotation mark was missing from the Target. At this point I wasn’t sure if this was a problem, but worth investigating:

2

Copying the command and running it from a standard PowerShell instance confirmed it, with no Lync Management Shell prompt returned, but rather a sign of an incomplete string:

 

3

 

Updating the command with the closing quotation mark on the end gave me the result I was after, returning a prompt:

4

Note the difference in command, with the additional quotation mark at the end of the second command:

powershell.exe -noexit -command “cd $env:UserProfile; Import-Module ‘C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1’

powershell.exe -noexit -command “cd $env:UserProfile; Import-Module ‘C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1’

To test, I ran the Lync cmdlet Get-CsManagementStoreReplicationStatus, which returned what I was expecting:

 

5

Now… What’s interesting is that if I go back to the same Lync Management Shell shortcut, without making any changes to the Target properties of the shortcut whatsoever, the Management Shell returns a prompt as expected:

 

6

We’re back in business.

Not sure if this is a Server 2012 R2 bug, or something specific with my lab, but at least it’s an easy fix.

Damien Margaritis

Insync Technology

20 Comments

  1. Hi,

    I have built quite a number of Lync Labs on 2012 R2 testing different scenarios. Uptil now I have only had this issues once so it does not seem to be a persistent issue.

  2. Thank you for this. I’ve been racking my brain for hours trying to figure out what is going on here.

  3. recently worked with a client who forgot to complete the above on the Edge server but gave wrong message “Host not found” even though host name of edge server was set up correctly.

  4. Good ol’ MS. Feel the quality! Thanks for putting this page together, I’d been scratching my head over that for a few days.

  5. running the command “import-module ‘C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1′ from a standard PowerShell command (without “Powershell.exe -noexit -command “cd $env:UserProfile;”) also does the trick.

    Great find! Thank you – needed this for both my single instance Lync 2013 Standard server (Windows 2012 R2) and for an admin box that hosts the admin tools for Lync (Windows 2008 R2). Both the server and Admin tools are on the latest rev’s available (OS/Lync).

Leave a reply to Dwight Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.