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

Posted in ,

20 responses to “Lync 2013/SfB 2015 Management Shell – Missing Prompt”

  1. Stuart Avatar

    Bit of a gotcha for R2 deployments

  2. Mike Avatar
    Mike

    Thanks for the post. I had the same problem. It doesn’t look like it’s your Lab issue.

  3. Chris Avatar
    Chris

    Wow good catch, spent a whole day trying to figure this out. Same issue on new deployment.

  4. Mike Avatar
    Mike

    Thanks, had the same issue in my 2012 R2 env. This solved the problem.

  5. Mike Avatar
    Mike

    Excellent – how weird that adding the quote to the target does not fix it.

  6. Mattias Kressmark Avatar
  7. Alessandro Bernardi Avatar
    Alessandro Bernardi

    Thank you! Very great post! Thanks for sharing

  8. Sebastian Striebeck Avatar
    Sebastian Striebeck

    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.

  9. BD Avatar
    BD

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

  10. Naimesh Mistry Avatar
    Naimesh Mistry

    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.

  11. Ant Avatar
    Ant

    Thanks worked for me on R2.

  12. Martin Devillers (@MartinDevillers) Avatar

    Worked for me on 2012 R2 Datacenter. Thank you for finding and fixing this rather sloppy mistake of Microsoft!

  13. JP Avatar
    JP

    What about simply this: Import-Module Lync

  14. Chris B. Avatar
    Chris B.

    Thank you, very good contribution

  15. Pichiruchi Avatar
    Pichiruchi

    Thank you…
    Worked like a charm…

  16. Paul V Avatar
    Paul V

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

  17. Dwight Avatar
    Dwight

    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).

  18. John Avatar

    Thanks.. You saved me hours of looking..

  19. Marcelo Avatar
    Marcelo

    Thank you. I had the same problem and this solved, “We’re back in business.” :).

  20. cruiserob Avatar

    Gr8 post…!! Helped me…

Leave a comment

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