I hope you can help me, first time making a post. I am analyzing a code that evaluates iis webapp controls from cis. The problem is that the code looks for the error code but it doesn't tell me for example "this error belongs to this webapp" and I would need that. Here is the piece of code I am trying to break down:
echo.%XML_TAG_CHILD_1st%^<^^!-- xccdf_org.cisecurity.benchmarks_rule_3.4_Ensure_IIS_HTTP_detailed_errors_are_hidden_from_displaying_remotely --^> >> %OUT_XML_FILE%
echo.%XML_TAG_CHILD_1st%^<ed03d68a-b631-4541-a96c-fbc4e72533a9^> >> %OUT_XML_FILE%
::Refer :::REM Prepare list of App Names"
(for /F "delims=" %%A in (cis-win-iis-AppNames.tmp) do appcmd list config "%%A" -section:system.webServer/httpErrors /text:errorMode) > 12c5e249bd615733bd7063dbb4d20e8b.errorMode.tmp
for /F %%T in (12c5e249bd615733bd7063dbb4d20e8b.errorMode.tmp) do echo.%XML_TAG_CHILD_2nd%^<apperrorMode^>%%T^</apperrorMode^> >> %OUT_XML_FILE%
echo.%XML_TAG_CHILD_1st%^</ed03d68a-b631-4541-a96c-fbc4e72533a9^> >> %OUT_XML_FILE%
echo. >> %OUT_XML_FILE%
Just in this part it looks for the errors in each of the webapps but it does not tell me which ones. Is there any way to show what they are? or which one it is analyzing?
(for /F "delims=" %%A in (cis-win-iis-AppNames.tmp) do appcmd list config "%%A" -section:system.webServer/httpErrors /text:errorMode) > 12c5e249bd615733bd7063dbb4d20e8b.errorMode.tmp
Thank you everyone!