WindowsUserAccount Class

An account that represents a user whose credentials and description are managed by Windows.
Inheritance Hierarchy

Namespace:  Dundas.BI.AccountServices
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.1.0.1001)
Syntax
public class WindowsUserAccount : ExternalUserAccount

The WindowsUserAccount type exposes the following members.

Constructors
  NameDescription
Public methodWindowsUserAccount(String, Boolean)
Initializes a new instance of the WindowsUserAccount class.
Public methodWindowsUserAccount(String, String)
Initializes a new instance of the WindowsUserAccount class.
Public methodWindowsUserAccount(String, String, Boolean)
Initializes a new instance of the WindowsUserAccount class.
Top
Properties
  NameDescription
Public propertyAccountType
Gets the type of the account.
(Inherited from Account.)
Public propertyActiveTenantId
Gets the active tenant ID for the account.
(Inherited from Account.)
Public propertyAllowedIPAddresses
Gets or sets the allowed IP addresses.
(Inherited from MembershipBaseObject.)
Public propertyCreatedTime
Gets the UTC time the account or group was created.
(Inherited from MembershipBaseObject.)
Public propertyCulture
Gets or sets the culture associated with the account or group.
(Inherited from MembershipBaseObject.)
Public propertyCustomAttributes
Gets the account or group's explicitly assigned custom attributes.
(Inherited from MembershipBaseObject.)
Public propertyDeniedApplicationPrivilegeIds
Gets the IDs of standard privileges denied to the account or group.
(Inherited from MembershipBaseObject.)
Public propertyDescription
Gets or sets a description that may be associated with the account or group.
(Inherited from MembershipBaseObject.)
Public propertyDisplayName
Gets or sets the display name of the account.
(Inherited from Account.)
Public propertyEffectiveDisplayName
Gets the effective display name of the account.
(Inherited from Account.)
Public propertyEmailAddress
Gets or sets the account's email address.
(Inherited from Account.)
Public propertyFederatedAuthenticationProviderIds
Gets a collection containing the IDs of any federated authentication providers that can be used in conjunction with the account.
(Inherited from ExternalAccount.)
Public propertyGrantedApplicationPrivilegeIds
Gets the IDs of standard privileges granted to the account or group.
(Inherited from MembershipBaseObject.)
Public propertyId
Gets the unique identifier of the account or group.
(Inherited from MembershipBaseObject.)
Public propertyIsApiAccount
Gets or sets a value indicating whether the account is an "API account".
(Inherited from Account.)
Public propertyIsEnabled
Gets or sets a value indicating whether the account is enabled.
(Inherited from Account.)
Public propertyIsGlobal
Gets or sets a value indicating whether the account is a global account.
(Inherited from Account.)
Public propertyIsSeatReserved
Gets or sets a value indicating whether the account has a reserved seat.
(Inherited from Account.)
Public propertyIsVirtual
Gets a value indicating whether the Windows account is virtual.
(Overrides ExternalUserAccountIsVirtual.)
Public propertyLastLogOnIpAddress
Gets the IP address where the user last logon.
(Inherited from Account.)
Public propertyLastLogOnTime
Gets the UTC time the account last logged on.
(Inherited from Account.)
Public propertyLogOnCount
Gets the number of times this account has logged on.
(Inherited from Account.)
Public propertyName
Gets or sets the name of the account or group.
(Inherited from MembershipBaseObject.)
Public propertySeatKind
Gets or sets the kind of the seat used by the account or group.
(Inherited from MembershipBaseObject.)
Public propertySessionTimeout
Gets or sets the explicit session idle timeout for the account.
(Inherited from Account.)
Public propertySingleTenantId
Gets or sets the ID of the single tenant associated with the account/group.
(Inherited from MembershipBaseObject.)
Public propertyTenantId
Gets or sets the ID of the tenant associated with the account/group.
(Inherited from MembershipBaseObject.)
Public propertyTenantIds
Gets a collection containing the IDs of the tenant(s) associated with the account/group.
(Inherited from MembershipBaseObject.)
Public propertyTimeZone
Gets or sets the time zone associated with the account.
(Inherited from MembershipBaseObject.)
Public propertyTrackLogOnHistory
Gets or sets a value indicating whether log on history should be tracked for the account.
(Inherited from Account.)
Public propertyWarnings
Gets a list of warnings associated with the instance.
(Inherited from MembershipBaseObject.)
Top
Methods
  NameDescription
Public methodSetFederatedAuthenticationProviderIds
Sets the federated authentication provider IDs.
(Inherited from ExternalAccount.)
Top
Examples

This example demonstrates how to create the Dundas BI engine, start the Dundas BI engine, log on, create a windows user account, and then shutdown the Dundas BI engine.

C#
using Dundas.BI;
using Dundas.BI.AccountServices;
using Dundas.BI.Services;
using System.Collections.ObjectModel;
   ...

// Create the engine.
EngineManager.CreateEngine(
    // Path to the application's data folder. Type: System.String
    @"C:\Program Files\Dundas Data Visualization Inc\Dundas BI\Instances\Instance1\www\BIWebsite\App_Data"
);

try
{
    // Start the Dundas BI Engine.
    EngineManager.StartEngine();

    // Create a caller context not associated with any session.
    using(Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null))
    {

        // LogOn.
        LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
            // The account name. Type: System.String
            "admin",
            // The password. Type: System.String
            "1234",
            // Delete other sessions for the logon to succeed. Type: System.Boolean
            true,
            // Culture to associate with the session, or null. Type: System.Globalization.CultureInfo
            null
        );

        // Set the current session ID.
        using(Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
            logOnResult.Session.Id
        );

        // Get the account service.
        IAccountService accountService =
            Engine.Current.GetService<IAccountService>();

        // Define the windows user account.
        WindowsUserAccount account = new WindowsUserAccount("dundas", "johns");

        // Define some properties
        account.EmailAddress = "JohnS@dundas.com";
        account.DisplayName = "John Smith";
        account.SeatKind = Dundas.BI.Licensing.LicenseSeatKind.StandardUser;
        account.IsSeatReserved = true;

        // Save the account.
        accountService.SaveAccount(account);

    }

}
finally
{
    EngineManager.ShutdownEngine();
}
See Also