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’”
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:
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:
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:
Updating the command with the closing quotation mark on the end gave me the result I was after, returning a prompt:
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:
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:
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.
Bit of a gotcha for R2 deployments
Thanks for the post. I had the same problem. It doesn’t look like it’s your Lab issue.
Wow good catch, spent a whole day trying to figure this out. Same issue on new deployment.
Thanks, had the same issue in my 2012 R2 env. This solved the problem.
Excellent – how weird that adding the quote to the target does not fix it.
Thanks! This helped!
Thank you! Very great post! Thanks for sharing
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.
Thank you for this. I’ve been racking my brain for hours trying to figure out what is going on here.
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.
Thanks worked for me on R2.
Worked for me on 2012 R2 Datacenter. Thank you for finding and fixing this rather sloppy mistake of Microsoft!
What about simply this: Import-Module Lync
Thank you, very good contribution
Worked like a charm…
Good ol’ MS. Feel the quality! Thanks for putting this page together, I’d been scratching my head over that for a few days.
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).
Thanks.. You saved me hours of looking..
Thank you. I had the same problem and this solved, “We’re back in business.” :).
Gr8 post…!! Helped me…