Microsoft KB Archive/281701

From BetaArchive Wiki

Article ID: 281701

Article Last Modified on 10/2/2003



APPLIES TO

  • Microsoft Metadirectory Services 2.2 Service Pack 1



This article was previously published under Q281701

SUMMARY

This article describes how to schedule management agents (MAs) to run by using a batch file. This article describes how to write the batch file and schedule it to run by using the using the Microsoft Windows 2000 Task Scheduler tool.

MORE INFORMATION

  1. Create a command-line script to schedule the MA. This method of scheduling MAs includes writing a batch file to start each MA sequentially. The following sample batch file demonstrates a script that you can use in a batch file or program file. You then use the Windows 2000 Task Scheduler tool to start the file.

    Use the following script to run all MAs sequentially:
    1. Start Notepad and type the following information. This is a sample script for a delta run:

      Echo Starting run of Exchange MA
      f:\zoomserv\bin\zscript -dn "ma=EXCHMA1,DsaName=Server1,ou=Applications,dc=microsoft,dc=com" -define "Action=DELTA"
      Echo End of Exchange MA

      Echo Starting run of TAMA MA
      F:\zoomserv\bin\zscript -dn "ma=Provisioning Agent,DsaName=Server1,ou=Applications,dc=microsoft,dc=com"
      Echo End of TAMA

      Echo Starting Delta run of ADMA
      f:\zoomserv\bin\zscript -dn "ma=ADMA,DsaName=Server1, ou=Applications,dc=microsoft,dc=com" -define "Action=DELTA"
      Echo End of ADMA

      This is a sample script for a full run:

      Echo Starting run of Exchange MA
      f:\zoomserv\bin\zscript -dn "ma=EXCHMA1,DsaName=Server1,ou=Applications,dc=microsoft,dc=com" -define "Action=FULL"
      Echo End of Exchange MA

      Echo Starting run of TAMA MA
      F:\zoomserv\bin\zscript -dn "ma=Provisioning Agent,DsaName=Server1,ou=Applications,dc=microsoft,dc=com"
      Echo End of TAMA

      Echo Starting run of ADMA
      f:\zoomserv\bin\zscript -dn "ma=ADMA,DsaName=Server1, ou=Applications,dc=microsoft,dc=com" -define "Action=FULL"
      Echo End of ADMA

      NOTE: These samples are designed only as an example. You must adapt these examples to your situation and MAs.

    2. Save the file as Scheduler.bat in the C:\Zoomserv\Bin folder.

    NOTE: To effectively make use of the -define statement in these scripts, see the following Microsoft Knowledge Base article, which describes how to use the zscript -define parameter to control Management Agents:

    297884 How to Use the Zscript '-define' Parameter to Control Management Agents at Run-Time

  2. Use one of the available scheduling services to schedule the batch file. The scheduling services that are available include: Microsoft Window NT 4.0 Server:

    • The At.exe command-line scheduler
    • The WinAT scheduler from the Microsoft Windows NT 4.0 Resource Kit

    Windows 2000 Server:

    • Task Scheduler
    • At.exe

    Using Task Scheduler in Windows NT 4.0 with Microsoft Internet Explorer 4.0 or Later

    1. In the Winnt\Tasks folder in Windows NT Explorer, double-click Add Scheduled Task.
    2. Click Next.
    3. Click Browse.
    4. In the Select Program to Schedule dialog box, browse to the C:\Zoomserv\Bin folder.
    5. Click Scheduler.bat, and then click Open.
    6. Click One time only, and then click Next.
    7. Change the start time to about two minutes ahead of the current time; leave the start date set to the current date.
    8. Click Next. You see the screen for the user account that the task will use. Type the user name and password that you are currently logged on with.
    9. Click Finish.

    Using WinAT from the Resource Kit

    1. On the File menu, click New to display the Add Command dialog box.
    2. In the Command box, type c:\zoomserv\bin\Scheduler.bat.
    3. Click Today, Tomorrow, Every, or Next.
    4. In the Days and Time boxes, click the days and time the command is to run.
    5. Click OK.

    Using Scheduled Task for Windows 2000

    1. Click Start, point to Settings, click Control Panel, and then double-click Scheduled Tasks.
    2. Double click Add Scheduled Tasks.
    3. Click Next
    4. Click Browse, and then locate the batch file that you created earlier in this article (Scheduler.bat).
    5. Keep the default name that matches your program name.
    6. Select the interval you want. For testing purposes click, One Time Only.
    7. Click Next
    8. Change the start time to about two minutes ahead of the current time; leave the start date set to the current date.
    9. Click Next. You see the screen for the user account that the task will use. Type the user name and password that you are currently logged on with.
    10. Click Next.
    11. Click Finish.

    Using the At.exe Command-Line Scheduler in Windows NT and Windows 2000

    Windows NT 3.5, 3.51, and 4.0

    1. Double-click Control Panel in the Main program group.
    2. Double-click Services.
    3. Double-click Schedule Service.
    4. In the Log On As box, click This Account.
    5. Add a user account that has administrative rights to the system.
    6. Type the account password and confirm the password.
    7. Click OK.
    8. To schedule the program to run, type the following line at a command prompt:

      at 4:30pm /interactive "c:\zoomserv\bin\scheduler.bat"

      NOTE: "4:30pm" is an example. Use a time about two minutes ahead of the current time for this test. When the time expires, the Zoomit service stops and the Scheduler.bat utility runs.

    Windows 2000

    1. Click Start, point to Programs, point to Accessories, point to System Tools, and then click Scheduled Tasks.
    2. Click Advanced, and then click AT Service Account.
    3. In the AT Service Account Configuration box, click This Account.
    4. Add a user account that has administrative rights to the system.
    5. Type the account password and confirm the password.
    6. Click OK.
    7. To schedule the program to run, type the following line at a command prompt:

      at 4:30pm /interactive "c:\zoomserv\bin\scheduler.bat"

      NOTE: "4:30pm" is an example. Use a time about two minutes ahead of the current time for this test. When the time expires, the Zoomit service stops and the Scheduler.bat utility runs.



Additional query words: MMS

Keywords: kbhowto kbenv KB281701