Class | Chef::Util::Windows::NetUser
In: | lib/chef/util/windows/net_user.rb
Parent: | Chef::Util::Windows

wrapper around a subset of the NetUser* APIs. nothing Chef specific, but not complete enough to be its own gem, so util for now.

### Methods

add check_enabled delete disable_account enable_account get_info new update user_modify validate_credentials

### Constants

LogonUser | = | Windows::API.new('LogonUser', 'SSSLLP', 'I', 'advapi32')
DOMAIN_GROUP_RID_USERS | = | 0x00000201
UF_SCRIPT | = | 0x000001
UF_ACCOUNTDISABLE | = | 0x000002
UF_PASSWD_CANT_CHANGE | = | 0x000040
UF_NORMAL_ACCOUNT | = | 0x000200
UF_DONT_EXPIRE_PASSWD | = | 0x010000

USER_INFO_3

=

[ [:name, nil], [:password, nil], [:password_age, 0], [:priv, 0], #"The NetUserAdd and NetUserSetInfo functions ignore this member" [:home_dir, nil], [:comment, nil], [:flags, UF_SCRIPT|UF_DONT_EXPIRE_PASSWD|UF_NORMAL_ACCOUNT], [:script_path, nil], [:auth_flags, 0], [:full_name, nil], [:user_comment, nil], [:parms, nil], [:workstations, nil], [:last_logon, 0], [:last_logoff, 0], [:acct_expires, -1], [:max_storage, -1], [:units_per_week, 0], [:logon_hours, nil], [:bad_pw_count, 0], [:num_logons, 0], [:logon_server, nil], [:country_code, 0], [:code_page, 0], [:user_id, 0], [:primary_group_id, DOMAIN_GROUP_RID_USERS], [:profile, nil], [:home_dir_drive, nil], [:password_expired, 0]

[:symbol_name, default_val] default_val duals as field type array index duals as structure offset

USER_INFO_3_TEMPLATE | = | USER_INFO_3.collect { |field| field[1].class == Fixnum ? 'i' : 'L' }.join
SIZEOF_USER_INFO_3 | = | #sizeof(USER_INFO_3) USER_INFO_3.inject(0){|sum,item| sum + (item[1].class == Fixnum ? 4 : PTR_SIZE)
LOGON32_PROVIDER_DEFAULT | = | 0
LOGON32_LOGON_NETWORK | = | 3

### Public Class methods

new(username)

### Public Instance methods

add(args)
check_enabled()
delete()
disable_account()
enable_account()
get_info()
update(args)
user_modify(&proc)
validate_credentials(passwd)

XXX for an extra painful alternative, see: support.microsoft.com/kb/180548

[Validate]