Using only built-in commands, I have scripted ADComp.bat to return the NetBIOS and distinguished name of all the computers in the domain you are logged on to.

The syntax for using ADComp.bat is:

for /f "Tokens=1* Delims=;" %%c in ('call ADComp') do (
 set name=%%c
 set dn=%%d
 . . .
)
NOTE: The output of ADComp.bat is a semi-colon delimited string, like:
JSI001;"CN=JSI001,OU=Domain Controllers,DC=JSIINC,DC=COM"
JSI009;"CN=JSI009,CN=Computers,DC=JSIINC,DC=COM"
ADComp.bat contains:
@echo off
setlocal
if exist "%TEMP%\ADComp.vbs" goto start
@echo.On Error Resume Next>"%TEMP%\ADComp.vbs"
@echo.Dim objConnection, objCommand, objRootDSE, strDNSDomain>>"%TEMP%\ADComp.vbs"
@echo.Dim strFilter, strQuery, objRecordSet>>"%TEMP%\ADComp.vbs"
@echo.Set objConnection = CreateObject("ADODB.Connection")>>"%TEMP%\ADComp.vbs"
@echo.Set objCommand = CreateObject("ADODB.Command")>>"%TEMP%\ADComp.vbs"
@echo.objConnection.Provider = "ADsDSOOBject">>"%TEMP%\ADComp.vbs"
@echo.objConnection.Open "Active Directory Provider">>"%TEMP%\ADComp.vbs"
@echo.Set objCommand.ActiveConnection = objConnection>>"%TEMP%\ADComp.vbs"
@echo.Set objRootDSE = GetObject("LDAP://RootDSE")>>"%TEMP%\ADComp.vbs"
@echo.strDNSDomain = objRootDSE.Get("defaultNamingContext")>>"%TEMP%\ADComp.vbs"
@echo.strBase = "<LDAP://" ^& strDNSDomain ^& ">" >>"%TEMP%\ADComp.vbs"
@echo.strFilter = "(&(objectCategory=computer))">>"%TEMP%\ADComp.vbs"
@echo.strAttributes = "distinguishedName,Name">>"%TEMP%\ADComp.vbs"
@echo.strQuery = strBase ^& ";" ^& strFilter ^& ";" ^& strAttributes ^& ";subtree">>"%TEMP%\ADComp.vbs"
@echo.objCommand.CommandText = strQuery>>"%TEMP%\ADComp.vbs"
@echo.objCommand.Properties("Page Size") = 99999>>"%TEMP%\ADComp.vbs"
@echo.objCommand.Properties("Timeout") = 300>>"%TEMP%\ADComp.vbs"
@echo.objCommand.Properties("Cache Results") = False>>"%TEMP%\ADComp.vbs"
@echo.Set objRecordSet = objCommand.Execute>>"%TEMP%\ADComp.vbs"
@echo.objRecordSet.MoveFirst>>"%TEMP%\ADComp.vbs"
@echo.Do Until objRecordSet.EOF>>"%TEMP%\ADComp.vbs"
@echo.    strDN = objRecordSet.Fields("distinguishedName")>>"%TEMP%\ADComp.vbs"
@echo.    strSA = objRecordSet.Fields("Name")>>"%TEMP%\ADComp.vbs"
@echo.    Wscript.Echo strSA ^& ";<div class="Contentquote"><center> ^& strDN ^& </center></div>">>"%TEMP%\ADComp.vbs"
@echo.    objRecordSet.MoveNext>>"%TEMP%\ADComp.vbs"
@echo.Loop>>"%TEMP%\ADComp.vbs"
@echo.objConnection.Close>>"%TEMP%\ADComp.vbs"
@echo.Set objConnection = Nothing>>"%TEMP%\ADComp.vbs"
@echo.Set objCommand = Nothing>>"%TEMP%\ADComp.vbs"
@echo.Set objRootDSE = Nothing>>"%TEMP%\ADComp.vbs"
@echo.Set objRecordSet = Nothing>>"%TEMP%\ADComp.vbs"
:start
cscript //nologo "%TEMP%\ADComp.vbs"
endlocal