Admin Script to restore data from data backup via DsTools
SCRIPT: ADDS_DsTools_DataRestore_IPTel.cmd
========== BEGINNING OF SCRIPT ==========
@ECHO OFF
SetLocal EnableDelayedExpansion
ECHO ============================================================
ECHO YL Library : ActiveDirectory DsTools
ECHO Restore IPTel Value From Backup
ECHO Author : Zhang Yunlong
ECHO Blog : ylnotes.blogspot.com
ECHO Filename : ADDS_DsTools_DataRestore_IPTel.cmd
ECHO ============================================================
ECHO History:
ECHO 1.0 Initial Release
ECHO ============================================================
::------------------------------------------------
::Data Restore
::------------------------------------------------
SET BACKUP_FILE=ADDS_DsTools_DataBackup.txt
SET RESTORE_LOG=ADDS_DsTools_DataRestore.txt
> %RESTORE_LOG% ECHO ADDS DsTools Data Restore (IPTel)
>> %RESTORE_LOG% ECHO %DATE% %TIME%
FOR /F "tokens=1,2,7 skip=1 delims=|" %%a IN (%BACKUP_FILE%) DO (
FOR /F "delims=!" %%d IN ('dsmod user "%%b" -iptel "%%c"') DO (
>> %RESTORE_LOG% ECHO [%%a] Restore IPTel Value "%%c" -^> %%d
)
)
START NOTEPAD.exe "%RESTORE_LOG%"
EXIT
========== ENDING OF SCRIPT ==========
No comments :
Post a Comment