Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Getting the Ticket for a Specified User

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);
      }
    }
  }
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.