Class Win32UserAccount
java.lang.Object
io.github.eggy03.ferrumx.windows.entity.user.Win32UserAccount
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 Summary
FieldsModifier and TypeFieldDescription(package private) @Nullable LongType of user account.(package private) @Nullable StringCaption of the user account (domain/username).(package private) @Nullable StringDescription of the user account.(package private) @Nullable BooleanTrue if the account is disabled.(package private) @Nullable StringDomain to which the user account belongs.(package private) @Nullable BooleanTrue if this is a local account.(package private) @Nullable BooleanTrue if the account is locked out.(package private) @Nullable StringName of the user account.(package private) @Nullable BooleanTrue if the password can be changed.(package private) @Nullable BooleanTrue if the password expires.(package private) @Nullable BooleanTrue if a password is required.(package private) @Nullable StringSecurity identifier (SID) for this account.(package private) @Nullable IntegerType of SID.(package private) @Nullable StringCurrent operational status of the account. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
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
Type of SID.- 1 — User
- 2 — Group
- 3 — Domain
- 4 — Alias
- 5 — WellKnownGroup
- 6 — DeletedAccount
- 7 — Invalid
- 8 — Unknown
- 9 — Computer
-
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
Caption of the user account (domain/username). -
description
Description of the user account. -
domain
Domain to which the user account belongs. -
name
Name of the user account. -
disabled
True if the account is disabled. -
localAccount
True if this is a local account. -
lockout
True if the account is locked out. -
passwordRequired
True if a password is required. -
passwordExpires
True if the password expires. -
passwordChangeable
True if the password can be changed. -
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
-
isLocalAccount
-
isLockedOut
-
isPasswordRequired
-
doesPasswordExpire
-
isPasswordChangeable
-
toString
-