class Sys::User
Constants
- INTERDOMAIN_TRUST
A permit to trust account for a domain that trusts other domains.
- NORMAL
Default account type that represents a typical user.
- SERVER_TRUST
A computer account for a backup domain controller that is a member of this domain.
- TEMP_DUPLICATE
An account for users whose primary account is in another domain.
- WORKSTATION_TRUST
An account for a Windows NT/2000 workstation or server that is a member of this domain.
Attributes
Returns the account type as a human readable string.
Domain and username of the account.
Description of the account.
The user's home directory
Used to set whether or not the account is disabled.
Name of the Windows domain to which a user account belongs.
Full name of a local user.
The user's primary group ID.
An array of groups to which the user belongs.
Date the user account was created.
Sets whether or not the account is defined on the local computer.
Sets whether or not the account is locked out of the OS.
Name of the Windows user account on the domain that the #domain property specifies.
The user's password.
Sets whether or not the password for the account can be changed.
Sets whether or not the password for the account expires.
Sets whether or not a password is required for the account.
The user's security identifier.
Current status for the user, such as “ok”, “error”, etc.
The user's id (RID).
Public Class Methods
Public Instance Methods
Sets the account type for the account. Possible values are:
-
User::TEMP_DUPLICATE
-
User::NORMAL
-
User::INTERDOMAIN_TRUST
-
User::WORKSTATION_TRUST
-
User::SERVER_TRUST
# File lib/windows/sys/admin.rb, line 201 def account_type=(type) case type when TEMP_DUPLICATE @account_type = 'duplicate' when NORMAL @account_type = 'normal' when INTERDOMAIN_TRUST @account_type = 'interdomain_trust' when WORKSTATION_TRUST @account_type = 'workstation_trust' when SERVER_TRUST @account_type = 'server_trust' else @account_type = 'unknown' end end
Returns whether or not the account is disabled.
# File lib/windows/sys/admin.rb, line 264 def disabled? @disabled end
Returns whether or not the account is local.
# File lib/windows/sys/admin.rb, line 270 def local? @local end
Returns whether or not the account is locked out.
# File lib/windows/sys/admin.rb, line 276 def lockout? @lockout end
Returns whether or not the password for the account is changeable.
# File lib/windows/sys/admin.rb, line 282 def password_changeable? @password_changeable end
Returns whether or not the password for the account is changeable.
# File lib/windows/sys/admin.rb, line 288 def password_expires? @password_expires end
Returns whether or not the a password is required for the account.
# File lib/windows/sys/admin.rb, line 294 def password_required? @password_required end
Returns the SID type as a human readable string.
# File lib/windows/sys/admin.rb, line 220 def sid_type @sid_type end
Sets the SID (Security Identifier) type to stype
, which can be
one of the following constant values:
-
Admin::SidTypeUser
-
Admin::SidTypeGroup
-
Admin::SidTypeDomain
-
Admin::SidTypeAlias
-
Admin::SidTypeWellKnownGroup
-
Admin::SidTypeDeletedAccount
-
Admin::SidTypeInvalid
-
Admin::SidTypeUnknown
-
Admin::SidTypeComputer
# File lib/windows/sys/admin.rb, line 237 def sid_type=(stype) case stype when Admin::SidTypeUser @sid_type = 'user' when Admin::SidTypeGroup @sid_type = 'group' when Admin::SidTypeDomain @sid_type = 'domain' when Admin::SidTypeAlias @sid_type = 'alias' when Admin::SidTypeWellKnownGroup @sid_type = 'well_known_group' when Admin::SidTypeDeletedAccount @sid_type = 'deleted_account' when Admin::SidTypeInvalid @sid_type = 'invalid' when Admin::SidTypeUnknown @sid_type = 'unknown' when Admin::SidTypeComputer @sid_type = 'computer' else @sid_type = 'unknown' end end