IMsTscNonScriptable::ClearTextPassword property

Sets the Remote Desktop ActiveX control password in plaintext format.

This property is write-only.


HRESULT put_ClearTextPassword(
  [in] BSTR newClearTextPass

Property value

The password to be used to connect, specified in plaintext format.

Error codes

Return S_OK if successful.


The password is passed to the server in the safely encrypted RDP communications channel. After a plaintext password is set, it cannot be retrieved in plaintext format.

The ClearTextPassword property can only be set when the Remote Desktop ActiveX control is not in the connected state. Setting this property fails if the control is connected. To check for the connected state, retrieve the IMsTscAx::Connected property.

You can also call this method to set a plaintext password before converting it to either a portable encoded password or to a binary (nonportable) encoded password. Note however that encoded passwords should not be considered securely encrypted.

If you first call this method to set a password in plaintext format, you can then convert the password to encoded format.

Aa382915.wedge(en-us,VS.85).gifTo convert a plaintext password to encoded format

  1. Set the password in plaintext format in the ClearTextPassword property.
  2. To retrieve the password in binary (nonportable) encoded format, retrieve the BinaryPassword property and the BinarySalt properties. Both the encoded password part and the salt part are required to set a password in binary encoded format.
  3. To retrieve the password in portable encoded format, retrieve the PortablePassword method and the PortableSalt properties. Both parts are required to set a password in portable encoded format.

After following the preceding three steps, you can set the password in encoded format by setting the BinaryPassword and BinarySalt properties, or PortablePassword and PortableSalt properties. Both parts are required.

To enable automatic logon, you must also set the UserName and Domain properties. If the password fails to authenticate the user, the Windows Logon dialog box is displayed at the server to prompt the user for the password.

For more information about Remote Desktop Web Connection, see Requirements for Remote Desktop Web Connection.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Type library





IID_IMsTscNonScriptable is defined as c1e6743a-41c1-4a74-832a-0dd06c1c7a0e

See also