Re: EnumLocalGroup.vbs - only want logon account name and description fields



On Jan 19, 1:03 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxxxxxxxxxxxxxxxx> wrote:
This is fairly easy to do. The script has two identical lines that output to
the console, one if the member is a member of a local group and another if
the member is a member of a nested domain group. Replace the two instances
of this line:

Wscript.Echo objMember.AdsPath

with the following:

Wscript.Echo strComputer & "," & objMember.Name & "," &
objMember.description

This works because the variable strComputer is a global variable (defined in
the main program) and so available in both subroutines. In both subroutines
we use the WinNT provider, so the .Name and .Description attributes give us
what you want. This gives the output in a comma delimited form that can be
read into a spread***. The program should be run at a command prompt using
the cscript host. The output can be redirected to a text file. For example
(assuming you are in the folder where the *.vbs file is saved):

cscript //nologo EnumLocalGroup.vbs > members.csv

If you want to delimit by tabs instead of commas, this can also be done. The
statement would be:

Wscript.Echo strComputer & vbTab & objMember.Name & vbTab &
objMember.description


Thank you for your response Richard. I am using the:

Wscript.Echo strComputer & vbTab & objMember.Name & vbTab &
objMember.description

From what I am seeing it is writing out the display name instead of
the logon id. Everything else is correct. I have a mixture of
Windows 2000 and Windows 23000 servers. Would this make a difference?

For example, the display name is: John Doe
and the logon id is: jdoe1250

So what it is writing out is:

server123 John Doe ** description **
server123 Jane Smith ** description ***

instead of:

server123 jdoe1250 ** description **
server123 jsmith389 ** description **


Mack
.


Loading