Export (0) Print
Expand All

Getting the Ticket for a Specified User

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Follow the instructions in Compiling a Sample to build and run the sample to get a ticket for a specified user.

using System;
using System.Net;
using Microsoft.LiveMeeting;

namespace WebSample
{
  class WebSampleClass
  {
    [STAThread]
    static void Main(string[] args)
    {
      try
      {
         LMWebService lmWebService = new LMWebService();
         lmWebService.Url = "https://localhost/LMPortal/LMWebService.asmx";
         lmWebService.Credentials = CredentialCache.DefaultCredentials;

         string windowsId = @"contoso\bill";
         string lmUserId;
         string name;
         string role;
         string ticketURL;
         int ticketTimeout;

         Status outcome = lmWebService.GetTicketFor(windowsId, out lmUserId, out name, out role, out ticketURL, out ticketTimeout);
         if (outcome == Status.Success)
         {
            Console.WriteLine("Ticket obtained for user " + windowsId);
            Console.WriteLine("lmUserId: " + lmUserId);
            Console.WriteLine("name: " + name);
            Console.WriteLine("role: " + role);
            Console.WriteLine("ticketURL: " + ticketURL);
            Console.WriteLine("ticketTimeout: " + ticketTimeout);
         }
         else
         {
            Console.WriteLine("Ticket not obtained for user " + windowsId +
                              " due to error " + outcome);
         }
      }
      catch (Exception ex)
      {
        Console.WriteLine("Exception=" + ex);
      }
    }
  }
}
Show:
© 2014 Microsoft