Partager via


IMAExtensible2Password.OpenPasswordConnection Method

Begins a password connection to the server.

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

Usage

'Usage
Dim instance As IMAExtensible2Password
Dim configParameters As KeyedCollection(Of String, ConfigParameter)
Dim partition As Partition

instance.OpenPasswordConnection(configParameters, partition)

Syntax

'Declaration
Sub OpenPasswordConnection ( _
    configParameters As KeyedCollection(Of String, ConfigParameter), _
    partition As Partition _
)
void OpenPasswordConnection (
    KeyedCollection<string,ConfigParameter> configParameters,
    Partition partition
)
void OpenPasswordConnection (
    KeyedCollection<String^, ConfigParameter^>^ configParameters, 
    Partition^ partition
)
void OpenPasswordConnection (
    KeyedCollection<String,ConfigParameter> configParameters, 
    Partition partition
)
function OpenPasswordConnection (
    configParameters : KeyedCollection<String,ConfigParameter>, 
    partition : Partition
)

Parameters

  • configParameters
    Contains a collection of objects.
  • partition
    Contains an object with the partition details on which the password operation should occur.

Remarks

Begins a password connection to the server. It is called prior to the GetConnectionSecurityLevel, SetPassword, and ChangePassword methods.

Exceptions: Return values, Errors, and Exceptions

The following is an example of OpenPasswordConnection:

 public void OpenPasswordConnection(KeyedCollection<string, ConfigParameter> configParameters, Partition partition)
        {
            // We do not use all the configParameters, which contain connection
            // details, in the sample but if one were to connect to a 
            // foreign system, they would use these parameters to do so.
 
            XmlWriterSettings xmlSettings = new XmlWriterSettings();
 
            // Determine encoding from Configuration Parmeters
            string encoding = configParameters["Export Encoding"].Value;
            if (encoding.Equals("ASCII"))
            {
                xmlSettings.Encoding = Encoding.ASCII;
            }
            else if (encoding.Equals("UTF8"))
            {
                xmlSettings.Encoding = Encoding.UTF8;
            }
            else
            {
                xmlSettings.Encoding = Encoding.Unicode;
            }
 
            // Begin file
            m_xmlWriterExport = XmlTextWriter.Create(MAUtils.MAFolder + @"\sample_password\sample_password.xml",xmlSettings);
            m_xmlWriterExport.WriteStartElement(Nodes.RootPassword);
 
            // Include partition DN
            m_xmlWriterExport.WriteElementString(Nodes.PartitionDN, partition.DN);
        }

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

IMAExtensible2Password Interface
IMAExtensible2Password Members
Microsoft.MetadirectoryServices Namespace