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 does not return a value until the run profile is complete or until a step in the run profile stops because of errors.

Note

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

mof
string Execute( [in]  RunProfileName
);

Parameters

In Language Name Data Type Description

1

 

RunProfileName

 

Contains the display name of the run profile of the management agent.

Name : Execute

Return Value

string

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 that are listed in WMI Provider Return Strings.

Name 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 that were 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. Forefront Identity Manager Synchronization Service (FIM Synchronization Service) 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 that was 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 that was 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 you start 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 you start 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. By default, the management agent folder is called %ProgramFiles%\Microsoft Forefront Identity Management\2010\Synchronization Service\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 removes 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 Stop Method. Do not use the keystroke combination CTRL+C to stop a management agent run that is started from a script. Using the keystroke combination CTRL+C stops the script engine but not the management agent run.

The following example shows how to use Microsoft 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.

Example

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

Product

Forefront Identity Manager Synchronization Service 2010

MOF

Mmswmi.mof

See Also

Reference

MIIS_ManagementAgent Class
WMI Provider Return Strings

Concepts

WMI Provider Reference
Methods