summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/util/windows/net_group.rb7
-rw-r--r--lib/chef/win32/net.rb13
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/chef/util/windows/net_group.rb b/lib/chef/util/windows/net_group.rb
index f90ff63ff7..10d01edc90 100644
--- a/lib/chef/util/windows/net_group.rb
+++ b/lib/chef/util/windows/net_group.rb
@@ -80,7 +80,12 @@ class Chef::Util::Windows::NetGroup < Chef::Util::Windows
end
def local_delete_members(members)
- modify_members(members, NetLocalGroupDelMembers)
+ begin
+ Chef::ReservedNames::Win32::NetUser::net_local_group_del_members(nil, @groupname, members)
+ rescue Chef::Exceptions::Win32NetAPIError => e
+ raise ArgumentError, e.msg
+ end
+
end
def local_delete
diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb
index 5027de3e90..0de310daf1 100644
--- a/lib/chef/win32/net.rb
+++ b/lib/chef/win32/net.rb
@@ -273,6 +273,19 @@ END
net_api_error!(rc)
end
end
+
+ def self.net_local_group_del_members(server_name, group_name, members)
+ server_name = wstring(server_name)
+ group_name = wstring(group_name)
+
+ lgrmi3s = members_to_lgrmi3(members)
+ rc = NetLocalGroupDelMembers(
+ server_name, group_name, 3, lgrmi3s[0], members.size)
+
+ if rc != NERR_Success
+ net_api_error!(rc)
+ end
+ end
end
end
end