Microsoft Identity Integration Server 2003 Developer Reference

Execute Method of the MIIS_ManagementAgent Class

The Execute method executes the specified run profile of the management agent. To use this method, you must be logged on as a member of the MIISOperators security group or the MIISAdmins security group. This method is a synchronous call that will not return a value until the run profile is complete or until a step in the run profile stops because of errors.

Warning  Do not run a management agent through a script when deleting any management agent because you can cause a failed run or corrupt a management agent configuration.

string Execute(
  string RunProfileName
);

Parameters

RunProfileName
[in] Contains the display name of the run profile of the management agent.

Return Values

Returns a string that contains the final status of the run profile. The return value can be one of the following values or one of the values listed in Return Strings.
Return code Description
access-denied The run step failed to start because the user name and password that were supplied do not belong to a member of the MIISAdmins or MIISOperators group on the server. Only members of those groups can run management agents.

Verify that the credentials used to run the management agent belong to a member of the MIISAdmins or MIISOperators group.

no-start-concurrent-execution-not-support The run step failed to start because two management agents of the same type are running concurrently. Microsoft Identity Integration Server 2003 supports running management agents concurrently except for the management agent for Lotus Notes Release 4.6 or 5.0.
no-start-unknown-profile-name The run step failed to start because the run profile name specified in the RunProfileName parameter is not recognized or does not exist.

Verify that the RunProfileName is correct.

no-start-ma-already-running The run step failed to start because the run profile name specified in the RunProfileName parameter is already running. You can run only one run profile of a management agent at a time. However, you can run several run profiles at the same time if the run profiles are from different management agents.

Stop the run profile that is currently running or wait until the run profile has finished running before starting another management agent run profile.

no-start-ma-update-in-progress The run step failed to start because a new management agent is being created or an existing management agent is being modified or deleted. You cannot run a management agent when a new management agent is being created or an existing management agent is being modified or deleted.

Wait until the management agent has been created, deleted, or modified before starting a management agent run profile.

no-start-ma-working-directory The run step failed to start because there is no working directory or a working directory could not be created for the management agent.

Verify that you have write access to the management agent folder, which is called, by default, C:\Program Files\Microsoft Identity Integration Server\MaData.

no-start-no-steps-in-profile The run step failed because the run profile contains a step that works on a partition that has been deleted. The server will remove steps from a run profile that refers to a deleted partition.

Verify that the run steps use partitions that exist.

success The method successfully ran the specified run profile name.

Remarks

To stop a management agent run that was started in a script, use the MIIS_ManagementAgent.Stop method. Do not use the keystroke combination Ctrl-C to stop a management agent run started from a script. Using the keystroke combination Ctrl-C stops the script engine but not the management agent run.

Example Code

The following example shows you how to use Visual Basic Scripting Edition (VBScript) to run a specified run profile of a management agent. This example runs the Full import run profile of the Fabrikam HR MA management agent.
[VBScript]
Option Explicit

On Error Resume Next

Dim Service
Dim ManagementAgent

Set Service = GetObject("winmgmts:root\MicrosoftIdentityIntegrationServer")
Set ManagementAgent = Service.Get("MIIS_ManagementAgent.Name='" & "Fabrikam HR MA" & "'")
WScript.Echo "Running " + ManagementAgent.name + ".Execute(""Full Import"")..."
WScript.Echo "Run completed with result: " + ManagementAgent.Execute("Full Import")

Sub ErrorHandler (ErrorMessage)
  WScript.Echo ErrorMessage
  WScript.Quit(1)
End Sub

Requirements

Server: Requires Microsoft Identity Integration Server 2003.
Header: Declared in mmswmi.mof.


See Also

MIIS_ManagementAgent, Return Strings