In tip 677, we used NETDOM to build a file of computer names in your domain.

Here is another method that doesn't require Supplement Two of the Resource kit (even though you should have it).

Use Regedit.exe to export a InputFileName.reg file, from your PDC, at:


You could use:

regedit /e "<Drive:>\<Path>\InputFileName.reg" "HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\Names"

The syntax of RegMember.bat is:

RegMember "<Drive:>\<Path>\OutputFileName.ext" "<Drive:>\<Path>\InputFileName.reg"


<Drive:>\<Path>\OutputFileName.ext will contain the output computer names.

<Drive:>\<Path>\InputFileName.reg   is the exported .reg file.

RegMember.bat contains:

@echo off
if "%2"<h1><a name="_goto_badp_If_exist_1_del_f_q_1_if_not_exist_2_goto_badp_set_input_2_set_output_1_for_f_Tokens_8_Delims_i_in_input_do_call_ismbr_i_endlocal_goto_end_badp_echo_Syntax_RegMember_lt_Drive_gt_lt_Path_gt_OutputFileName_ext_lt_Drive_gt_lt_Path_gt_InputFileName_reg_endlocal_goto_end_ismbr_set_tst_1_set_mbr_tst_if_mbr_">"" goto badp
If exist %1 del /f /q %1
if not exist %2 goto badp
set input=%2
set output=%1
for /f "Tokens=8 Delims=\" %%i in (%input%) do call :ismbr %%i
goto end
@echo Syntax: RegMember "<Drive:>\<Path>\OutputFileName.ext" "<Drive:>\<Path>\InputFileName.reg"
goto end
set tst=%1
set mbr=%tst:$\]=%
if "%mbr%"</a></h1>"%tst%" goto end
@echo %mbr% >> %output%