Chef cookbook to configure automatic logon
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
libraries
providers
resources
spec
test
.chefignore
.gitignore
.kitchen.appveyor.yml
.kitchen.yml
.rubocop.yml
Berksfile
CHANGELOG.md
CONTRIBUTING.md
Gemfile
LICENSE
README.md
Rakefile
appveyor.yml
metadata.rb

README.md

Windows Autologin Cookbook

Cookbook Version Build Status

Enables/disables automatic logon using Windows AutoAdminLogon.

Automatic logon uses username (domain can be included, e.g., domain\username) and password stored in the registry to log users on to the computer when the system starts. The Log On to Windows dialog box is not displayed.

Use count to limit the Number of Automatic Logins. Once the limit has been reached the auto logon feature will be disabled.

WARNING: Automatic logon allows other users to start your computer and to log on using your account, password is stored unencrypted under windows registry HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon when enabled, and Chef outputs the password when updating autologin registry.

Requirements

  • Chef 11.6+ (includes a built-in registry_key resource)

Platforms

  • Windows

Usage

Requires Administrator privileges.

Enable automatic login for user

windows_autologin 'enable autologin' do
  username 'username'
  password my_secret
  action :enable
end

Disable automatic login and remove password and count entry

windows_autologin 'username' do
  action :disable
end

Actions

  • enable - Enables autologin.
  • disable - Disables autologin.

Attributes

  • username - The username to autologin as. Defaults to resource block name. Note that username can include domain.
  • password - Required to enable. Default: nil.
  • count - Number of Automatic Logins. Once the limit has been reached the auto logon feature will be disabled. Default: 0.
  • confidential - Ensure that sensitive resource data is not logged by the chef-client. Default: true.

ChefSpec Matchers

This cookbook includes custom ChefSpec matchers you can use to test your own cookbooks.

Example Matcher Usage

expect(chef_run).to enable_windows_autologin('username').with(
  password: 'password'
)

Cookbook Matchers

  • enable_windows_autologin(resource_name)
  • disable_windows_autologin(resource_name)

Getting Help

Contributing

Please refer to CONTRIBUTING.

License

MIT - see the accompanying LICENSE file for details.