To remove a group, you need to know what kind of group it is: local or global. Two functions accommodate the removal:
Win32::NetAdmin::GroupDelete( ($Machine | $Domain), $Group ); Win32::NetAdmin::LocalGroupDelete( $Machine, $Group );
Just like the functions that add a group, the first parameter ($Machine) is a valid machine name (in the form of '\\machine') or an empty string (“”) that indicates the local machine. If you are removing a global group from a domain, specify the primary domain controller.
The second parameter ($Group) is the name of the group to be deleted.
If successful, the group will be removed from the machine, and a TRUE value will be returned; otherwise, a FALSE value will be returned.
The code in Example ...