Method: Chef::Util::Windows::NetUser#disable_account

Defined in:
lib/chef/util/windows/net_user.rb

#disable_accountObject



150
151
152
153
154
155
156
157
158
# File 'lib/chef/util/windows/net_user.rb', line 150

def 
  user_modify do |user|
    user[:flags] |= NetUser::UF_ACCOUNTDISABLE
    # This does not set the password to nil. It (for some reason) means to ignore updating the field.
    # See similar behavior for the logon_hours field documented at
    # http://msdn.microsoft.com/en-us/library/windows/desktop/aa371338%28v=vs.85%29.aspx
    user[:password] = nil
  end
end