Getting the Account Status

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 the account status.

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 lmUserId;
         string name;
         string role;
         string windowsId = @"contoso\bill";

         Status outcome = lmWebService.GetAccountStatus(windowsId, out lmUserId, out name, out role);
         if ((outcome == Status.HasAccount_Entitled) | (outcome == Status.HasAccount_NotEntitled) |
             (outcome == Status.NoAccount_Entitled) | (outcome == Status.NoAccount_NotEntitled))
         {
            Console.WriteLine("Account status obtained for user " + windowsId);
            Console.WriteLine("Status " + outcome);
            Console.WriteLine("lmUserId: " + lmUserId);
            Console.WriteLine("name: " + name);
            Console.WriteLine("role: " + role);
         }
         else
         {
            Console.WriteLine("Account status not obtained for user " + windowsId +
                              " due to error " + outcome);
         }
      }
      catch (Exception ex)
      {
        Console.WriteLine("Exception=" + ex);
      }
    }
  }
}

See Also

Concepts

GetAccountStatus