Share via


IMAExtensible2GetParameters.GetConfigParameters Method

Gets an array of values indicating the configuration parameter definitions supported by the management agent. This method is called to display the parameters in UI pages for configuring Connectivity, Global, Partition, and Run-Step parameters.

Namespace: Microsoft.MetadirectoryServices
Assembly: Microsoft.MetadirectoryServicesEx (in Microsoft.MetadirectoryServicesEx.dll)

Usage

'Usage
Dim instance As IMAExtensible2GetParameters
Dim configParameters As KeyedCollection(Of String, ConfigParameter)
Dim page As ConfigParameterPage
Dim returnValue As IList(Of ConfigParameterDefinition)

returnValue = instance.GetConfigParameters(configParameters, page)

Syntax

'Declaration
Function GetConfigParameters ( _
    configParameters As KeyedCollection(Of String, ConfigParameter), _
    page As ConfigParameterPage _
) As IList(Of ConfigParameterDefinition)
IList<ConfigParameterDefinition> GetConfigParameters (
    KeyedCollection<string,ConfigParameter> configParameters,
    ConfigParameterPage page
)
IList<ConfigParameterDefinition^>^ GetConfigParameters (
    KeyedCollection<String^, ConfigParameter^>^ configParameters, 
    ConfigParameterPage page
)
IList<ConfigParameterDefinition> GetConfigParameters (
    KeyedCollection<String,ConfigParameter> configParameters, 
    ConfigParameterPage page
)
function GetConfigParameters (
    configParameters : KeyedCollection<String,ConfigParameter>, 
    page : ConfigParameterPage
) : IList<ConfigParameterDefinition>

Parameters

Return Value

The list of child ConfigParameterDefinition objects.

Remarks

Parameters are values where the administrator can provide the value.

Parameters can be defined for the following uses:

  • Connectivity – defines parameters needed to connect to a system to do schema discovery. Those parameters will also appear during server configuration import.

  • Global – defines parameters global to the MA. The additional parameters are gathered after schema discovery has completed.

  • Partition – defines parameters where the value is different per partition.

  • Run Step – defines parameters where the value is different between run steps of the same type.

All values for already connected parameters from earlier pages will be passed to IMAExtensible2GetParameters, thus allowing for parameters to be added, updated, and deleted dynamically.

Parameters will appear in the UI in the order they are defined. The name of the parameter (first property) will be visible in the UI.

Parameters can have the following types:

Property

Description

Example

Label

A label is used to provide descriptive text to the user.

Properties:

  • Name of parameter (not shown in the UI)

  • Text to show

configParametersDefinitions.Add(ConfigParameterDefinition.CreateLabelParameter("Connection Details:"));

Delimiter

A delimiter is a horizontal bar.

Properties:

  • Name of parameter (not shown in the UI)

configParametersDefinitions.Add(ConfigParameterDefinition.CreateDividerParameter());

String

Properties:

  • Name of parameter

  • RegEx expression for string validation

configParametersDefinitions.Add(ConfigParameterDefinition.CreateStringParameter("Server", ""));

EncryptedString

Used to get passwords. Encrypted parameters are never exported in server configuration files.

Properties:

  • Name of parameter

  • RegEx expression for string validation

configParametersDefinitions.Add(ConfigParameterDefinition.CreateEncryptedStringParameter("Password", ""));

Text

Used to get longer strings and strings with carriage returns.

Properties:

  • Name of parameter

configParametersDefinitions.Add(ConfigParameterDefinition.CreateTextParameter("Enter your very long string:”));

CheckBox

Properties:

  • Name of parameter

  • Default value (true/false)

configParametersDefinitions.Add(ConfigParameterDefinition.CreateCheckBoxParameter("Partition Secure Connection", true));

DropDown

Properties:

  • Name of parameter

  • Array or comma-seperated list of options in the drop-down list.

  • Drop-down/combo box behavior. i.e. can the user type a value in the box or is it restricted to select from pre-defined values.

configParametersDefinitions.Add(ConfigParameterDefinition.CreateDropDownParameter("Export Encoding", "ASCII,Unicode,UTF8", false, "UTF8"));

File

The primary use is to allow the user to specify a binary value by supplying a file.

Properties:

  • Name of parameter

configParametersDefinitions.Add(ConfigParameterDefinition.CreateFileParameter("Browse for a File:"));

Exceptions: Return values, Errors, and Exceptions

The following is an example of GetConfigParameters:

  public IList<ConfigParameterDefinition> GetConfigParameters(KeyedCollection<string, ConfigParameter> configParameters,
                                                                    ConfigParameterPage page)
        {
            List<ConfigParameterDefinition> configParametersDefinitions = new List<ConfigParameterDefinition>();
            switch (page)
            {
                case ConfigParameterPage.Connectivity:
 
                    // Add a header label
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateLabelParameter("Connection Details:"));
 
                    // Allow user to enter the server
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateStringParameter("Server", ""));
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateDividerParameter());
 
                    // Get credentials
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateStringParameter("User", ""));
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateEncryptedStringParameter("Password", ""));
 
                    // Provide connection options
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateCheckBoxParameter("Secure Connection", true));
                    break;
 
                case ConfigParameterPage.Global:
 
                    // Allow user to set the export encoding & format
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateLabelParameter("Export Options:"));
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateDropDownParameter("Export Encoding", "ASCII,Unicode,UTF8", false, "UTF8"));
                    break;
 
                case ConfigParameterPage.Partition:
 
                    // Add a header label
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateLabelParameter("Connection Details:"));
 
                    // Allow partition-level credentials
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateStringParameter("Partition User", ""));
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateEncryptedStringParameter("Partition Password", ""));
 
                    // Allow partition-level connection properties
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateCheckBoxParameter("Partition Secure Connection", true));
                    break;
 
                case ConfigParameterPage.RunStep:
 
                    // Provide a run step parameter for Xml declaration
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateLabelParameter("Export Options:"));
                    configParametersDefinitions.Add(ConfigParameterDefinition.CreateCheckBoxParameter("Omit Xml Declaration", false));
                    break;
            }
 
            return configParametersDefinitions;
        }

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Target Platforms

Change History

See Also

Reference

IMAExtensible2GetParameters Interface
IMAExtensible2GetParameters Members
Microsoft.MetadirectoryServices Namespace