I have the following batch script which grabs computer names out of "ad.txt" and then uses psexec to remote to the computer, grab the UUID, and then add the entry into AD so I can make existing computers Managed in AD.
My issue is that the script is not working. What am I missing?
for /F "tokens=*" %%F in (ad.txt) do call :wdsadd %%F
for /f %%I IN (
'psexec \\^%1 cmd /c "echo csproduct get UUID|wmic.exe" ^| ^
findstr /r ........-....-....-....-............ '
) do wdsutil /set-device /device:%1 /id:%%~I