An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam. Built for students by a student to help them understand the concepts that they are being taught.
:: =============== :: READ THIS FIRST :: =============== :: * This script require "Computers.txt" file from where it will pick computer names. :: * Copy and paste following script in notepad and save it with any name having .cmd extension. :: *** SCRIPT START *** @ECHO OFF SETLOCAL EnableDelayedExpansion IF NOT EXIST Computers.txt GOTO ShowErr FOR %%R IN (Computers.txt) DO IF %%~zR EQU 0 GOTO ShowErr IF EXIST CompMgr.ldf DEL /F /Q CompMgr.ldf FOR /F %%c IN ('TYPE Computers.txt') Do ( ECHO Processing: %%c DSQuery Computer -Name %%c |FIND /I "CN=">NUL IF NOT ERRORLEVEL 1 ( FOR /F "delims=*" %%d IN ('DSQuery Computer -Name %%c') DO (( ECHO DN: %%~d ECHO changetype: modify ECHO replace: managedBy ECHO managedBy: %%~d ECHO - ECHO. ECHO DN: %%~d ECHO changetype: modify ECHO delete: managedBy ECHO - ECHO.)>>CompMgr.ldf) ) ELSE (ECHO *** ERROR *** %%c: System NOT Found in AD.) ) ECHO. IF EXIST CompMgr.ldf LDIFDE -I -K -F CompMgr.ldf GOTO EndScript :ShowErr ECHO "Computers.txt" file does not exist or file is empty! :EndScript IF EXIST CompMgr.ldf DEL /F /Q CompMgr.ldf ENDLOCAL :: *** SCRIPT END ***
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.