I use a batch job to do this. I create a comma delimited text file that contains entries with the following syntax:
GroupType,Group Name,User Name where:
Group Type is G for a Domain Global Group, W for a Workstation Local Group, and L for a Domain Local Group.
Create the following two batch files in your path:
del /q %2
for /f "tokens=1-3 delims=," %%i in ('type %1') do call DELUSRG %%i "%%j" "%%k" >>%2 2>>&1
if /i "%1"
if /i "%1"=="w" goto wlg
net group %2 %3 /DELETE /DOMAIN
net localgroup %2 %3 /DELETE /DOMAIN
net localgroup %2 %3 /DELETE
To run the batch file, I create as many entries in the text file as I need and then invoke DELFROMG:
DELFROMG "<Drive:>\folder\textfile.txt" "<Drive:>\Directory\logfile.log"