user()
Returns the detailed attributes of a single user account by username.
Unlike users(), this method returns complete account information including
login statistics, password expiry, and MFA configuration.
1. Signature
-
Sync
-
Async
ecm.security.user(username: str) -> ECMUserAttributes | None
await ecm.security.user(username: str) -> ECMUserAttributes | None
2. Parameters
| Parameter | Default | Description |
|---|---|---|
|
— |
Internal user name (e.g. |
3. Return value
ECMUserAttributes instance, or None if the user was not found.
3.1. ECMUserAttributes fields
| Field | Type | Description |
|---|---|---|
|
|
Numeric user ID. |
|
|
Short internal user name. |
|
|
Login credential name used for authentication. |
|
|
Full display name. |
|
|
E-mail address. |
|
|
Globally unique identifier of the user account. |
|
|
Profile ID: |
|
|
|
|
|
Optional remark. |
|
|
Account type identifier. |
|
|
Bit-field of user flags. |
|
|
Language ID of the user. |
|
|
Number of times the user has logged in. |
|
|
Name of the station from the last login. |
|
|
Timestamp of the last login. |
|
|
Timestamp of the last account modification. |
|
|
Multi-factor authentication flag. |
|
|
|
|
|
|
|
|
Timestamp of the last password change. |
|
|
ID of the home server for this account. |
|
|
Default station name assigned to the user. |
|
|
User ID of the supervisor. |
|
|
Account valid-from date. |
|
|
Account valid-to date. |
4. Examples
4.1. Load a user and inspect attributes
-
Sync
-
Async
user = ecm.security.user("john")
if user:
print(user.display_name, user.email, user.guid)
print(f"Last login: {user.login_time}")
print(f"Login count: {user.login_count}")
if user.locked:
print("Account is locked")
user = await ecm.security.user("john")
if user:
print(user.display_name, user.email, user.guid)
print(f"Last login: {user.login_time}")
5. See also
-
users() — Retrieve all user accounts
-
roles() — System roles of a user
-
user_groups() — Groups of a user