How many ways can you think of to export the members of a local group to a text file? The really simple method is running net localgroup 'group name' > textfile.txt locally, but this adds extra descriptive info that needs to be cleaned up later. You may also encounter environments where the net command is not accessible.
Here's my version with fun little interactive input and message boxes. Easy to use, works remotely, and builds the list with names only:
'retrieve local group membership
Dim intCount, strGroup, strDomain, oGroup, oMember
Dim fso, myFile, strOutput
strGroup = InputBox("Group to query?")
strDomain = InputBox("Domain or machine that hosts the group?")
strOutput = InputBox("Enter the output file name:")
set oGroup = GetObject("WinNT://" & strDomain & "/" & strGroup & ",group")
Set fso = CreateObject("Scripting.FileSystemObject")
Set myFile = fso.CreateTextFile(strOutput, True)
For Each oMember in oGroup.Members
intCount = intCount + 1
msgbox "Group: " & strGroup & " hosted by: " & strDomain & " has " & intCount & " members" & (Chr(13) & Chr(10)) & "See file " & strOutput
'end of script
The last line of the script starts with msgbox and ends with strOutput, so when copying it remember to remove the carrage return / wordwrap. Same goes for the set oGroup line. Save it in notepad as yournamehere.vbs and then execute it.