Delete Multiple Groups

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I've got a server with hundreds of local groups on it. They were created
from an old Site Server installation and, of course, no longer needed
anymore. Is there an easy way to delete all of these at once...since I can
only select one at a time in the Computer Management > Groups console?
Thanks
 
From: "basin" <[email protected]>

| Hi,
|
| I've got a server with hundreds of local groups on it. They were created
| from an old Site Server installation and, of course, no longer needed
| anymore. Is there an easy way to delete all of these at once...since I can
| only select one at a time in the Computer Management > Groups console?
| Thanks

Create a script that uses 'net localgroup "GROUPNAME" /delete' to remove the unwanted
groups.

Running "net localgroup" should display a list of groups and you can redirect it to a disk
file and edit it to be used by the script.such that each group name appears without and
asterisk and each name is on its own line.

Example:
net localgroup >groups.txt

Then execute; notepad groups.txt to make the file usable for the script.

Kixtart Script sample...
---------------------------------------
$procedurefile="groups.txt"
IF Open(1,$procedurefile,2)=0
$GroupName=ReadLine(1)
WHILE @ERROR=0
shell 'net localgroup "$GroupName" /delete'
$GroupName=ReadLine(1)
LOOP
Close(1)
ENDIF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top