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_MACHINE\SAM\SAM\Domains\Account\Users\Names
You could use:
The syntax of RegMember.bat is:
RegMember "<Drive:>\<Path>\OutputFileName.ext" "<Drive:>\<Path>\InputFileName.reg"
where:
<Drive:>\<Path>\OutputFileName.ext will contain the output computer names.
<Drive:>\<Path>\InputFileName.reg is the exported .reg file.
RegMember.bat contains:
@echo off setlocal if "%2""" 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 "<Drive:>\<Path>\OutputFileName.ext" "<Drive:>\<Path>\InputFileName.reg" endlocal goto end :ismbr set tst=%1 set mbr=%tst:$\]=% if "%mbr%"
"%tst%" goto end @echo %mbr% >> %output% :end
0 comments
Hide comments