Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
:: =============== :: 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.