Only a few more days until Skype for Business Server 2015 is here! We’re eagerly prepping a virtual server for testing.

Is anyone seeing Skype for Business Online in their Office 365 accounts yet? If so, please comment or email. I’d like to hear your thoughts on the transition experience.

In the meantime, we have another troubleshooting post for today. This one’s on PowerShell – or more specifically, Lync Server Management Shell.

NOTE: Today’s issue took place on Windows Server 2012 R2. You’ll see why that’s important in a moment.

While working on a client’s Lync Server Front End, Larry kept noticing that he would load the Lync Server Management Shell…but he didn’t receive a command prompt. Only an empty black window would pop up.

Removing & recreating the shortcut didn’t help. Larry confirmed that the Management Shell and Control Panel showed no errors. What was causing this?

Discussion amongst the Lync team found none of us had encountered this before. To the search engines!

The Culprit: The Shortcut Target String

Microsoft Support Forums didn’t yield an answer in the first couple searches. But they did lead us to a fellow IT consultant’s blog, over in the UK:
Lync 2013 Powershell – Blank Screen: MSV Blog

Matt posted about the very same PowerShell error last year. Interestingly, he notes that he didn’t get a Management Shell prompt “from time to time.” It would seem that this error is sometimes “overcome” by the OS, allowing it to run PowerShell properly.

That suggests the problem isn’t with PowerShell itself, but with something calling it. And indeed, that’s what Matt discovered. His Lync Server Management Shell shortcut target was missing something:

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

Can you spot it? Look at the end of the string. A single quotation mark…but no closing quote for the one before “cd $env:UserProfile”.

We checked the client’s Windows Server again. Sure enough, its Management Shell shortcut didn’t have a closing quote either.

We added the quote back into the Management Shell shortcut, like so:

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

Then unpinned the shortcut from the taskbar & repinned. Poof, PowerShell came right up.

Kudos to Matt for his sharp eyes! Please visit his blog for more detail on this error & many other Microsoft-related troubleshooting posts.

Where Does This Bug Come From?

Matt believes this is a Windows Server 2012 R2 bug, as it didn’t occur consistently among his Lync Server2013 installations. I’m inclined to agree, though I can’t fully dismiss a Lync Server bug, for one reason. PowerShell is not limited to Lync Server, but it’s the Lync Server Management Shell shortcut which “hosts” the bug.

Either way, it was likely introduced by a recent Microsoft Update. Since Matt’s post is dated March 2014, it could be this Windows Server 2012 R2 Update: https://support.microsoft.com/en-us/kb/2928678

Or one of the packages in this Lync Server 2013 Update: https://support.microsoft.com/en-us/kb/2863908

We’re not 100% sure. But the important thing is, if you keep your Windows Servers up-to-date (which you should always do), you may encounter this error with PowerShell.

And thanks to Matt, we have a quick solution.

As we saw with last week’s Skype4B UI post, PowerShell continues its importance in the next version of Lync. Have you experienced a PowerShell error? If so, please comment or email with the details.

(P.S. – A couple people commented that they could not find the “EnableSkypeUI” parameter! Here’s a post to help you out, courtesy of Blog.Kloud.com.au: EnableSkypeUI Where Art Thou? – Kloud)

Management Shell Showing a Blank Window? A Bug’s Stopping PowerShell From Loading
Facebooktwittergoogle_plusredditlinkedinmail
Tagged on:         

7 thoughts on “Management Shell Showing a Blank Window? A Bug’s Stopping PowerShell From Loading

  • January 20, 2016 at 6:14 am
    Permalink

    I found if you open regular powershell and do a import-module lync , after it loads, close it and go back and open Lync Mgmt Shell, it opens with no issues without the double quote. Weird but it works.

    Reply
    • January 20, 2016 at 10:00 am
      Permalink

      Thanks for the tip James!

      Reply
  • April 11, 2016 at 5:14 am
    Permalink

    Try changing the target string and then change it back to its original string.

    Worked for me!

    Thanks though…this was bugging me for a while.

    Reply
  • November 7, 2016 at 9:28 am
    Permalink

    We publish our management tools via terminal services to the different support groups in our environment. the issue popped up without any particular cause. One moment everything is working, the next moment we get an unresponsive session. Log of and on again, nothing happens except a blank powershell window. Checked the RDREMOTEAPP -requiredcommandline and indeed the closing ” was missing. Checked the session hosts (2 servers) for the Management Shell short cuts, and yes again the closing ” missing. Added the missing ” to the commandlinesettings in remoteapp, which did not resolve the issue. Modified both shortcuts on the sessionhosts, and suddenly everything is working again. Cannot see the relation between the shortcut settings and the requiredcommandline settings in remoteapp, as they are basically the same “-noexit -command “cd $env:UserProfile; Import-Module ‘C:\Program Files\Common Files\Microsoft Lync Server 2013\Modules\Lync\Lync.psd1′””.

    Reply
  • December 15, 2016 at 11:06 pm
    Permalink

    Thanks. This has help me a lot a few times when i saw this error (Lync 2013)

    Reply
  • June 13, 2017 at 11:52 pm
    Permalink

    Thanks so much was really stuck on this and it worked like a charm

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *