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
- 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:- 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 ADMAThis 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 ADMANOTE: These samples are designed only as an example. You must adapt these examples to your situation and MAs.
- 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
- Start Notepad and type the following information. This is a sample script for a delta run:
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
- In the Winnt\Tasks folder in Windows NT Explorer, double-click Add Scheduled Task.
- Click Next.
- Click Browse.
- In the Select Program to Schedule dialog box, browse to the C:\Zoomserv\Bin folder.
- Click Scheduler.bat, and then click Open.
- Click One time only, and then click Next.
- Change the start time to about two minutes ahead of the current time; leave the start date set to the current date.
- 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.
- Click Finish.
Using WinAT from the Resource Kit
- On the File menu, click New to display the Add Command dialog box.
- In the Command box, type c:\zoomserv\bin\Scheduler.bat.
- Click Today, Tomorrow, Every, or Next.
- In the Days and Time boxes, click the days and time the command is to run.
- Click OK.
Using Scheduled Task for Windows 2000
- Click Start, point to Settings, click Control Panel, and then double-click Scheduled Tasks.
- Double click Add Scheduled Tasks.
- Click Next
- Click Browse, and then locate the batch file that you created earlier in this article (Scheduler.bat).
- Keep the default name that matches your program name.
- Select the interval you want. For testing purposes click, One Time Only.
- Click Next
- Change the start time to about two minutes ahead of the current time; leave the start date set to the current date.
- 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.
- Click Next.
- Click Finish.
Using the At.exe Command-Line Scheduler in Windows NT and Windows 2000
Windows NT 3.5, 3.51, and 4.0
- Double-click Control Panel in the Main program group.
- Double-click Services.
- Double-click Schedule Service.
- In the Log On As box, click This Account.
- Add a user account that has administrative rights to the system.
- Type the account password and confirm the password.
- Click OK.
- To schedule the program to run, type the following line at a command prompt:
at 4:30pm /interactive "c:\zoomserv\bin\scheduler.bat"
Windows 2000
- Click Start, point to Programs, point to Accessories, point to System Tools, and then click Scheduled Tasks.
- Click Advanced, and then click AT Service Account.
- In the AT Service Account Configuration box, click This Account.
- Add a user account that has administrative rights to the system.
- Type the account password and confirm the password.
- Click OK.
- To schedule the program to run, type the following line at a command prompt:
at 4:30pm /interactive "c:\zoomserv\bin\scheduler.bat"
Additional query words: MMS
Keywords: kbhowto kbenv KB281701