Using NETDOM from the Windows 2000 Support Tools, or NETDOM from the .NET Server support tools, or NETDOM from the Windows XP support tools, and $poslen, I have scripted Computers.bat.

The syntax for using Computers.bat is:

Computers Objects

where Objects is a string made up of one or more of the following computer types:

  W - Member Workstations
  S - Member Servers
  P - PDC (emulator)
  D - Domain Controllers.

Sample Usage

To generate a file of all the computers in your domain:

computers WDS>Drive:\Folder\Computers.txt

To process all the computer names in a batch file:

@echo off
setlocal
for /f "Tokens=*" %%a in ('computers WSD') do call <a href="/article/jsifaq/jsi-tip-5845-hide-items-in-the-add-remove-programs-applet-of-control-panel-using-a-batch-.aspx">HideFromAddRemove</a> "\\%%a" "Microsoft Windows Critical Update Notification"
endlocal
goto :EOF

Computers.bat contains:

@echo off
setlocal
if \{%1\}<h1><a name="_goto_syntax_set_object_1_set_object_object_set_a_cnt_0_verify_call_poslen_object_cnt_1_if_i_substring_EQU_W_set_a_cnt_cnt_1_amp_goto_verify_if_i_substring_EQU_S_set_a_cnt_cnt_1_amp_goto_verify_if_i_substring_EQU_P_set_a_cnt_cnt_1_amp_goto_verify_if_i_substring_EQU_D_set_a_cnt_cnt_1_amp_goto_verify_if_i_not_substring_">\{\} goto syntax
set object=%1
set object=%object:"=%
set /a cnt=0
:verify
call $poslen %object% %cnt% 1
if /i "%$substring%" EQU "W" set /a cnt=%cnt% + 1&goto verify
if /i "%$substring%" EQU "S" set /a cnt=%cnt% + 1&goto verify  
if /i "%$substring%" EQU "P" set /a cnt=%cnt% + 1&goto verify
if /i "%$substring%" EQU "D" set /a cnt=%cnt% + 1&goto verify
if /i not "%$substring%"</a></h1>"ECHO is on." goto syntax
set /a cnt=0
:loop
call $poslen %object% %cnt% 1
if /i "%$substring%" EQU "W" set ot=WORKSTATION&goto loopinc  
if /i "%$substring%" EQU "S" set ot=SERVER&goto loopinc  
if /i "%$substring%" EQU "P" set ot=PDC&goto loopinc  
if /i "%$substring%" EQU "D" set ot=DC&goto loopinc
endlocal
goto :EOF
:loopinc
set /a cnt=%cnt% + 1
For /f "Skip=1 Tokens=1" %%i in ('netdom query %ot%') do call :computer "%%i"
goto loop
:Syntax
@echo Syntax: Computers Objects
endlocal
goto :EOF
:computer
set machine=%1
set machine=%machine:"=%
if "%machine%" EQU "The" goto :EOF
if "%machine%" EQU "Directory" goto :EOF
call set machine=%%machine:.%USERDNSDOMAIN%^=%%
@echo %machine%