Skip to content

Instantly share code, notes, and snippets.

@trekr5
Created March 24, 2015 16:27
Show Gist options
  • Save trekr5/02e879519c81157c95e9 to your computer and use it in GitHub Desktop.
Save trekr5/02e879519c81157c95e9 to your computer and use it in GitHub Desktop.
remove rights
def remove_login_rights(user)
cookbook_file "ntrights.exe" do
source "ntrights.exe"
path "C:/users/#{user}"
mode '0644'
action :create_if_missing
notifies :run, 'execute[remove-right]', :immediately
end
execute "remove-right" do
#cwd "C:\\windows\\temp"
command "cmd && ntrights -u #{user} +r SeDenyInteractiveLogonRight"
action :nothing
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment