Saturday 5 February 2011

Remote Lync Shell Shortcut

A quick post on how to create a shortcut to the Lync shell.
One of the major administrative benefits for me with Lync Server 2010 is the CSCP and the ability to run most of the day to day admin tasks from a local PC.
Lync also supports the remote shell by publishing the shell via IIS. There are many posts out there on how to create a one off session but I want to go one step further and create a shortcut to the Lync Shell.

Step 1: Create the remote shell script
  • Open your favourite text editor
  • Add the line: $Credential = Get-Credential
  • Add the line: $PS-Session=New-PSSession -ConnectUri https://lyncadmin.domain.com/ocspowershell -Credential $Credential -AllowRedirection
  • Add the line: Import-PSSession $PSSession
  • Save the file to a custom folder such as C:\Scripts for instance as LyncAdmin.ps1

Step 2: Create the shortcut

  • Create a new shortcut
  • Set the location as: c:\Windows\System32\WindowsPowershell\v1.0\Powershell.exe -noexit C:\Scripts\LyncAdmin.ps1
  • Give it a name
  • Save it to the desktop or similar

You should now be able to double click the shorcut and the script will run. This script will prompt for credentials and then load the Lync cmdlets. This method can also be used to create shortcuts to other scripts.

Enjoy!

No comments:

Post a Comment