Removing a Group

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 ...

Get Win32 Perl Programming: The Standard Extensions, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.