psIMAlerts - Tutorial - Remoting



The following tutorial shows the steps to use psIMAlerts on a host other than the Lync or OCS server with psIMAlerts.

Note this tutorial requires Windows Management Framework (which includes Powershell 2.0 and WinRM) be installed on both the Lync or OCS server and the remote host. The download for this software is contain in KB968930.

After psIMAlerts and Windows Management framework is installed on the Lync or OCS server do the following to enable remote PowerShell sessions:
  1. Logon to the Lync or OCS server as a local administrator
  2. Start a Command ('DOS') Window
  3. Set a HTTP service principle name; at the prompt enter
    copy
    setspn -a http/%COMPUTERNAME%.%USERDNSDOMAIN% %COMPUTERNAME%

    Note: The SETSPN.EXE utility can be downloaded from here.
    Note: if your machine is in a separeate DNS domain to your desktop account then use the machine domain. copy
  4. Start PowerShell as an Administrator
  5. At the prompt enter
    copy
    Enable-PSRemoting
    This will
    start the WinRM service and set the startup type to Automatic
    enable a firewall exception for WS-Managment communications.
    creates a listener to accept requests for any IP Address.
  6. At the prompt enter
    copy
    Set-Item WSMan:\localhost\Client\TrustedHosts *
    Note: the Set-Item command with '*' will allow any host to create a remote PowerShell session with your Lync or OCS server. Change the '*' option to suite your environment's security requirements.
  7. At the prompt enter
    copy
    Restart-Service winrm

After Windows Managment Framwork is installed on remote host and the OCS or Lync server, and remote Powershell is enabled on the Lync or OCS server to send an IM Alert from a remote host do the following:
  1. Logon to the remote host with a domain account that has local admin priveleges on the host and on the Lync or OCS server.
  2. Open a PowerShell windows (run as Administrator)
  3. Start a remote PowerShell session on the Lync or OCS server from the remote host. If the name of the Lync server with psIMAlert is named LYNC0001 enter:
    copy
    Enter-PSSession LYNC0001
  4. To load psIMAlerts in to the session at the prompt enter
    copy
    Add-PSSnapin psimalert
  5. To send a test alert to an account with a loginId of fredn at the prompt enter
    copy

  6. To end the remote session at the prompt enter
    copy
    Exit-PSSession