private void shutdownServerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.server.IsTerminalServer)
     {
         if (
             MessageBox.Show("Are you sure you want to shutdown this server?",
                             "Confirmation required ...",
                             MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
         {
             TerminalServicesApi.ShutdownSystem(this.server, false);
         }
     }
 }
 private void logoffSessionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.SelectedSession != null)
     {
         if (
             MessageBox.Show("Are you sure you want to log off the selected session?",
                             "Confirmation required ...",
                             MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
         {
             TerminalServicesApi.LogOffSession(this.SelectedSession, false);
         }
     }
     else
     {
         MessageBox.Show("Please select a session");
     }
 }
        private void sendMessageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.SelectedSession != null)
            {
                string input = "Please enter the message to send..";

                if (InputBox.Show(ref input) == DialogResult.OK && !string.IsNullOrWhiteSpace(input))
                {
                    TerminalServicesApi.SendMessage(this.SelectedSession,

                                                    "Message from your administrator (sent via " + Kohl.Framework.Info.AssemblyInfo.Title + ")",
                                                    input.Trim(), 0, 10, false);
                }
            }
            else
            {
                MessageBox.Show("Please select a session");
            }
        }