Class: Chef::Util::Windows::NetGroup
- Inherits:
-
Object
- Object
- Chef::Util::Windows::NetGroup
- Defined in:
- lib/chef/util/windows/net_group.rb
Overview
wrapper around a subset of the NetGroup* APIs.
Instance Method Summary collapse
-
#initialize(groupname) ⇒ NetGroup
constructor
A new instance of NetGroup.
- #local_add ⇒ Object
- #local_add_members(members) ⇒ Object
- #local_delete ⇒ Object
- #local_delete_members(members) ⇒ Object
- #local_get_members ⇒ Object
- #local_group_set_info(comment) ⇒ Object
- #local_set_members(members) ⇒ Object
Constructor Details
#initialize(groupname) ⇒ NetGroup
Returns a new instance of NetGroup.
33 34 35 |
# File 'lib/chef/util/windows/net_group.rb', line 33 def initialize(groupname) @groupname = groupname end |
Instance Method Details
#local_add ⇒ Object
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_delete ⇒ Object
73 74 75 76 77 |
# File 'lib/chef/util/windows/net_group.rb', line 73 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
67 68 69 70 71 |
# File 'lib/chef/util/windows/net_group.rb', line 67 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_members ⇒ Object
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_group_set_info(comment) ⇒ Object
61 62 63 64 65 |
# File 'lib/chef/util/windows/net_group.rb', line 61 def local_group_set_info(comment) Chef::ReservedNames::Win32::NetUser.net_local_group_set_info(nil, groupname, comment) 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 |