JSI Tip 1102. Another way to build a file of member computer names in your domain.

Jerold Schulman

February 26, 1999

1 Min Read
ITPro Today logo


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:

HKEY_LOCAL_MACHINESAMSAMDomainsAccountUsersNames

You could use:

regedit /e "InputFileName.reg" "HKEY_LOCAL_MACHINESAMSAMDomainsAccountUsersNames"

The syntax of RegMember.bat is:

RegMember " OutputFileName.ext" " InputFileName.reg"

where:

OutputFileName.ext will contain the output computer names.

InputFileName.reg   is the exported .reg file.

RegMember.bat contains:

@echo offsetlocalif "%2"

"" goto badpIf exist %1 del /f /q %1if not exist %2 goto badpset input=%2set output=%1for /f "Tokens=8 Delims=" %%i in (%input%) do call :ismbr %%iendlocalgoto end:badp@echo Syntax:RegMember "OutputFileName.ext" "InputFileName.reg"endlocalgoto end:ismbrset tst=%1set mbr=%tst:$]=%if "%mbr%"

"%tst%" goto end@echo %mbr% >> %output%:end


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like