ServerAPI.GetLocatableUser Method

Searches for a provisioned user by domain and alias.

Public Function GetLocatableUser (domainAlias As System.String)

      _ As Microsoft.MapPoint.LocationServer.Types.LocatableUser
[C#]
public Microsoft.MapPoint.LocationServer.Types.LocatableUser GetLocatableUser (System.String domainAlias);

Parameters

Remarks

This method returns details about the user details as a LocatableUser obejct. If no matches are found, null (Nothing in Microsoft® Visual Basic® .NET) is returned.

To check only the user properties such as Visible, NotifyOnNewContact, and so on, use the ServerAPI.GetVisibility, ServerAPI.SetVisibility, ServerAPI.GetNewContactNotification and ServerAPI.SetNewContactNotification methods that are specifically designed to retrieve these properties. By doing so, you can avoid the performance overhead associated with retrieving all contact lists for the current user.

If no match is found for the domain and alias that is being passed, a UserNotProvisionedException exception is thrown.

Example

 
[Visual Basic]
    'Create a new instance of the ServerAPI class
    Dim MyServerAPI As New ServerAPI

    Try
        'Initialize the database connection for ServerAPI operations
        MyServerAPI.Initialize("Your SQL Server Name", "LocationServerDB")
        'Now get the locatable user with a domain alias DOMAIN\user 
        Dim MyLocatableUser As LocatableUser = MyServerAPI.GetLocatableUser("DOMAIN\user")
        'Process the locatable user according to your needs
        Dim DisplayName As String = MyLocatableUser.DisplayName
    Catch MyException As Exception
        'Process your exceptions here
        Console.WriteLine(MyException.GetType().Name)
    Finally
        'Do cleanup
        MyServerAPI = Nothing
    End Try

 
[C#]
  //Create a new instance of the ServerAPI class
  ServerAPI MyServerAPI = new ServerAPI();
  try
  {
   //Initialize the database connection for ServerAPI operations
   MyServerAPI.Initialize("Your SQL Server Name", "LocationServerDB");
   //Now get the locatable user with a domain alias DOMAIN\user 
   LocatableUser MyLocatableUser = MyServerAPI.GetLocatableUser(@"DOMAIN\user");

   //Process the locatable user according to your needs
   string DisplayName = MyLocatableUser.DisplayName;

  }
  catch(Exception MyException)
  {
   //Process your exceptions here
   Console.WriteLine(MyException.GetType().Name);
  }
  finally
  {
   //Do cleanup
   MyServerAPI = null;
  }    

  
 

See Also

LocatableUser Class  |  Microsoft.MapPoint.LocationServer.Management  |  ServerAPI Class  |  ServerAPI Members  |  ServerAPIException Class