Class Win32UserAccount

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.user.Win32UserAccount

@ShallowImmutable public class Win32UserAccount extends Object
Immutable representation of a User Account in system running Windows.

Fields correspond to properties retrieved from the Win32_UserAccount WMI class.

Usage examples

// Build a new instance
Win32UserAccount systemAccount = Win32UserAccount.builder()
    .sid("S-1-5-21-0987654321-1002")
    .sidType(1)
    .accountType(512)
    .caption("User2")
    .description("Administrator account")
    .domain("WORKGROUP")
    .name("Admin")
    .build();

// Create a modified copy
Win32UserAccount updated = systemAccount.toBuilder()
    .name("Admin-PC")
    .build();

Since:
3.0.0
See Also:
  • Field Details

    • sid

      @SerializedName("SID") @Nullable @Nullable String sid
      Security identifier (SID) for this account. A SID is a string value of variable length that is used to identify a trustee. Each account has a unique SID that an authority, such as a Windows domain, issues. The SID is stored in the security database. When a user logs on, the system retrieves the user SID from the database, places the SID in the user access token, and then uses the SID in the user access token to identify the user in all subsequent interactions with Windows security. Each SID is a unique identifier for a user or group, and a different user or group cannot have the same SID.
    • sidType

      @SerializedName("SIDType") @Nullable @Nullable Integer sidType
      Type of SID.
      • 1 — User
      • 2 — Group
      • 3 — Domain
      • 4 — Alias
      • 5 — WellKnownGroup
      • 6 — DeletedAccount
      • 7 — Invalid
      • 8 — Unknown
      • 9 — Computer
    • accountType

      @SerializedName("AccountType") @Nullable @Nullable Long accountType
      Type of user account.
      • 256 — Temporary duplicate account
      • 512 — Normal account
      • 2048 — Interdomain trust account
      • 4096 — Workstation trust account
      • 8192 — Server trust account
    • caption

      @SerializedName("Caption") @Nullable @Nullable String caption
      Caption of the user account (domain/username).
    • description

      @SerializedName("Description") @Nullable @Nullable String description
      Description of the user account.
    • domain

      @SerializedName("Domain") @Nullable @Nullable String domain
      Domain to which the user account belongs.
    • name

      @SerializedName("Name") @Nullable @Nullable String name
      Name of the user account.
    • disabled

      @SerializedName("Disabled") @Nullable @Nullable Boolean disabled
      True if the account is disabled.
    • localAccount

      @SerializedName("LocalAccount") @Nullable @Nullable Boolean localAccount
      True if this is a local account.
    • lockout

      @SerializedName("Lockout") @Nullable @Nullable Boolean lockout
      True if the account is locked out.
    • passwordRequired

      @SerializedName("PasswordRequired") @Nullable @Nullable Boolean passwordRequired
      True if a password is required.
    • passwordExpires

      @SerializedName("PasswordExpires") @Nullable @Nullable Boolean passwordExpires
      True if the password expires.
    • passwordChangeable

      @SerializedName("PasswordChangeable") @Nullable @Nullable Boolean passwordChangeable
      True if the password can be changed.
    • status

      @SerializedName("Status") @Nullable @Nullable String status
      Current operational status of the account.

      Possible OPERATIONAL values:

      • "OK"
      • "Degraded"
      • "Pred Fail"

      Possible NON-OPERATIONAL values:

      • "Unknown"
      • "Error"
      • "Starting"
      • "Stopping"
      • "Service"

      Possible OTHER values:

      • "Stressed"
      • "NonRecover"
      • "No Contact"
      • "Lost Comm"
  • Constructor Details

    • Win32UserAccount

      public Win32UserAccount()
  • Method Details

    • isDisabled

      @Nullable public @Nullable Boolean isDisabled()
    • isLocalAccount

      @Nullable public @Nullable Boolean isLocalAccount()
    • isLockedOut

      @Nullable public @Nullable Boolean isLockedOut()
    • isPasswordRequired

      @Nullable public @Nullable Boolean isPasswordRequired()
    • doesPasswordExpire

      @Nullable public @Nullable Boolean doesPasswordExpire()
    • isPasswordChangeable

      @Nullable public @Nullable Boolean isPasswordChangeable()
    • toString

      @NotNull public @NotNull String toString()
      Retrieves the entity in a JSON pretty-print formatted string
      Overrides:
      toString in class Object
      Returns:
      the String value of the object in JSON pretty-print format