Class: Chef::Util::Windows::NetGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/util/windows/net_group.rb

Overview

wrapper around a subset of the NetGroup* APIs.

Instance Method Summary collapse

Constructor Details

#initialize(groupname) ⇒ NetGroup


33
34
35
# File 'lib/chef/util/windows/net_group.rb', line 33

def initialize(groupname)
  @groupname = groupname
end

Instance Method Details

#local_addObject


43
44
45
46
47
# File 'lib/chef/util/windows/net_group.rb', line 43

def local_add
  Chef::ReservedNames::Win32::NetUser.net_local_group_add(nil, groupname)
rescue Chef::Exceptions::Win32APIError => e
  raise ArgumentError, e
end

#local_add_members(members) ⇒ Object


55
56
57
58
59
# File 'lib/chef/util/windows/net_group.rb', line 55

def local_add_members(members)
  Chef::ReservedNames::Win32::NetUser.net_local_group_add_members(nil, groupname, members)
rescue Chef::Exceptions::Win32APIError => e
  raise ArgumentError, e
end

#local_deleteObject


67
68
69
70
71
# File 'lib/chef/util/windows/net_group.rb', line 67

def local_delete
  Chef::ReservedNames::Win32::NetUser.net_local_group_del(nil, groupname)
rescue Chef::Exceptions::Win32APIError => e
  raise ArgumentError, e
end

#local_delete_members(members) ⇒ Object


61
62
63
64
65
# File 'lib/chef/util/windows/net_group.rb', line 61

def local_delete_members(members)
  Chef::ReservedNames::Win32::NetUser.net_local_group_del_members(nil, groupname, members)
rescue Chef::Exceptions::Win32APIError => e
  raise ArgumentError, e
end

#local_get_membersObject


37
38
39
40
41
# File 'lib/chef/util/windows/net_group.rb', line 37

def local_get_members
  Chef::ReservedNames::Win32::NetUser.net_local_group_get_members(nil, groupname)
rescue Chef::Exceptions::Win32APIError => e
  raise ArgumentError, e
end

#local_set_members(members) ⇒ Object


49
50
51
52
53
# File 'lib/chef/util/windows/net_group.rb', line 49

def local_set_members(members)
  Chef::ReservedNames::Win32::NetUser.net_local_group_set_members(nil, groupname, members)
rescue Chef::Exceptions::Win32APIError => e
  raise ArgumentError, e
end