O'Reilly logo

Win32 Perl Programming: The Standard Extensions, Second Edition by Dave Roth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required