How do I write a batch file that executes DirSync for multiple projects? (NETIQKB1398)

  • 7701398
  • 02-Feb-2007
  • 02-Nov-2007

Resolution

goal
How do I write a batch file that executes DirSync for multiple projects?

fact
Exchange Migrator 1.x

fact
Exchange Migrator 2.x

fix

This is a sample syntax of a batch file, the syntax needs to be modified to work for your specific migration. NetIQ Technical Support does not troubleshoot incorrect syntax of batch files.

You need to change the NAME_OF_PROJECT to the name of the project that you have created. If you have two or more projects, you need to change NAME_OF_2nd_PROJECTand you would also need to replace the NEXT_PROJECT_NAME with the name of the project you want to execute next. You will also need to modify the path of the target containter where you want the objects to be created ( /targetcontainer "ou=Exchange 5.5 Users, ou=IT, dc=usa, dc=com"). The last line in the batch file should be: Echo Completed.

Here is the syntax.

rem******************************************************************************

@ECHO OFF

for /F "tokens=1-4 delims=/ " %%i in ('date /t') do ( set DayOfWeek=%%i set Month=%%j set Day=%%k set Year=%%l set Date=%%i %%j/%%k/%%l )

cd\

cd Dirsync_logs

md %month%_%day%_%year%

cd\

cd program files

cd netiq

cd exchange migrator


:NAME_OF_PROJECT

rem ***********************************************************************

rem *** NAME OF PROJECT TO KEEP SOME ORDER IN THE MADNESS ***

rem ***********************************************************************

if EXIST "C:\Dirsync_Logs\%month%_%day%_%year%\dirsync_NAME_oF_PROJECT.txt" goto :NAME_OF_PROJECTend

call EMCLI DirSync.exe /project "NAME OF PROJECT" /direction "sourcetotarget" /targetcontainer "ou=Exchange 5.5 Users, ou=IT, dc=usa, dc=com" /mergemethod none /veryverbose >C:\Dirsync_Logs\%month%_%day%_%year%\dirsync_NAME_OF_PROJECT.txt

echo NAME_OF_PROJECT Dirsync Completed

goto :NAME_OF_2nd_PROJECT

:NAME_OF_PROJECTend

echo NAME_OF_PROJECT Dirsync has already run today


:NAME_OF_2nd_PROJECT

rem *********************************************************************

rem *** NAME OF 2nd PROJECT TO KEEP SOME ORDER IN THE MADNESS ***

rem *********************************************************************

if EXIST "C:\Dirsync_Logs\%month%_%day%_%year%\dirsync_NAME_OF_2nd _PROJECT.txt" goto :NAME_OF_2nd_PROJECTend

call EMCLI DirSync.exe /project "NAME OF 2nd PROJECT" /direction "sourcetotarget" /targetcontainer "ou=Exchange 5.5 Users, ou=IT, dc=usa, dc=com" /mergemethod none /veryverbose >C:\Dirsync_Logs\%month%_%day%_%year%\dirsync_NAME_OF_2nd_PROJECT.txt

echo NAME_OF_2nd_PROJECT Dirsync Completed

goto :NEXT_PROJECT_NAME

:NAME_OF_2nd_PROJECTend

echo NAME_OF_PROJECT Dirsync has already run today

Echo Completed

rem******************************************************************************

For more information on what DirSync does:

NETIQKB1153 What does the EMDirSync tool synchronize?

NETIQKB1383 Why are my target custom recipients not being replaced when migrating mailboxes?



note

Please contact Technical Support to create a 'Support Request' for any issues you encounter that are not addressed by the User Guide, any Knowledge Base articles found on the website, or current Hotfixes or Service Packs available for download.



Additional Information

Formerly known as NETIQKB1398

Feedback service temporarily unavailable. For content questions or problems, please contact Support.