Wie mache ich eine Verknüpfung einer Remotedesktopverbindung und füge das Kennwort ein?

Ich möchte eine Remotedesktopverbindung direkt über eine Verknüpfung öffnen und das Kennwort für den Benutzernamen in die Verknüpfung einbetten.

Wie erhalte ich den Pfad eines Remotedesktops von einer RDP-Verknüpfung und können wir das Kennwort in einer RDP-Verknüpfung festlegen?

Author: HopelessN00b, 2010-02-28

5 answers

Wenn Sie die RDP-Datei speichern, aktivieren Sie das Kontrollkästchen Mein Passwort speichern. Dadurch wird Ihr Kennwort in einem verschlüsselten Format in der Datei .RDP gespeichert. Seien Sie jedoch vorsichtig, da die Leute herausgefunden haben wie man es entschlüsselt:

alt-text

 12
Author: John T,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-08-26 03:55:57

Versuchen Sie die Bearbeitung der .rdp-Dateien direkt. Ich habe einen Artikel gefunden, Wie RDP-Passwörter verschlüsselt werden, der sagt, wie und tief in den Posts gibt es auch Code dafür in C#:

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Security.Cryptography;
using System.Linq;
using System.Text;

class Mstscpw
{
    private const int CRYPTPROTECT_UI_FORBIDDEN = 0x1;
    // Wrapper for the NULL handle or pointer.
    static private IntPtr NullPtr = ((IntPtr)((int)(0)));
    // Wrapper for DPAPI CryptProtectData function.
    [DllImport("crypt32.dll", SetLastError = true,
    CharSet = System.Runtime.InteropServices.CharSet.Auto)]
    private static extern bool CryptProtectData(
    ref DATA_BLOB pPlainText,
    [MarshalAs(UnmanagedType.LPWStr)]string szDescription,
    IntPtr pEntroy,
    IntPtr pReserved,
    IntPtr pPrompt,
    int dwFlags,
    ref DATA_BLOB pCipherText);
    // BLOB structure used to pass data to DPAPI functions.
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
    internal struct DATA_BLOB
    {
        public int cbData;
        public IntPtr pbData;
    }

    private static void InitBLOB(byte[] data, ref DATA_BLOB blob)
    {
        blob.pbData = Marshal.AllocHGlobal(data.Length);
        if (blob.pbData == IntPtr.Zero)
            throw new Exception("Unable to allocate buffer for BLOB data.");

        blob.cbData = data.Length;
        Marshal.Copy(data, 0, blob.pbData, data.Length);
    }

    public string encryptpw(string pw)
    {
        byte[] pwba = Encoding.Unicode.GetBytes(pw);
        DATA_BLOB dataIn = new DATA_BLOB();
        DATA_BLOB dataOut = new DATA_BLOB();
        StringBuilder epwsb = new StringBuilder();
        try
        {
            try
            {
                InitBLOB(pwba, ref dataIn);
            }
            catch (Exception ex)
            {
                throw new Exception("Cannot initialize dataIn BLOB.", ex);
            }

            bool success = CryptProtectData(
            ref dataIn,
            "psw",
            NullPtr,
            NullPtr,
            NullPtr,
            CRYPTPROTECT_UI_FORBIDDEN,
            ref dataOut);

            if (!success)
            {
                int errCode = Marshal.GetLastWin32Error();
                throw new Exception("CryptProtectData failed.", new Win32Exception(errCode));
            }

            byte[] epwba = new byte[dataOut.cbData];
            Marshal.Copy(dataOut.pbData, epwba, 0, dataOut.cbData);
            // Convert hex data to hex characters (suitable for a string)
            for (int i = 0; i < dataOut.cbData; i++)
                epwsb.Append(Convert.ToString(epwba[i], 16).PadLeft(2, '0').ToUpper());
        }
        catch (Exception ex)
        {
            throw new Exception("unable to encrypt data.", ex);
        }
        finally
        {
            if (dataIn.pbData != IntPtr.Zero)
                Marshal.FreeHGlobal(dataIn.pbData);

            if (dataOut.pbData != IntPtr.Zero)
                Marshal.FreeHGlobal(dataOut.pbData);
        }
        return epwsb.ToString();
    }
}
// Test code:
class program
{
    static void Main(string[] args)
    {
        Mstscpw mstscpw = new Mstscpw();
        string epw = mstscpw.encryptpw("password");
        Console.WriteLine("Encrypted password for \"password\" {0} characters: \r\n{1}", epw.Length, epw);
        Console.ReadLine();
    }
}
 5
Author: Tipx,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2012-04-27 13:03:20

Remote Desktop Plus von Donkz.nl.

Funktion #1:

Melden Sie sich automatisch über die Befehlszeile an.

Beispiel:

rdp /v:nlmail01 /u:administrator /p:P@ssw0rd! /max
 2
Author: abstrask,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2012-04-27 13:09:30

Alternativ erstellen Sie ein batch-Skript (.bat) mit folgenden Zeilen:

cmdkey /generic:"computername or IP" /user:"username" /pass:"password" mstsc /v:"computer name or IP"

Hinweis Ersetzen Sie die IP, den Benutzernamen und das Kennwort im Skript durch die gültigen Anmeldeinformationen.

Führen Sie nun das Skript aus, indem Sie einfach darauf doppelklicken.

Dies funktioniert.

 1
Author: user427276,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2015-03-12 07:29:07

Nun, teilweise korrekt, Sie können die Microsoft-Anmeldeinformationen nicht wirklich einfach bearbeiten,und der Befehl ist nicht rdp, aber wenn Sie den Befehl mstsc ausführen, wird das Problem mit dem Kennwort speichern unter WinXP behoben.

Zugriff auf Remotedesktop über die Befehlszeile

mstsc [<connection file>] [/v:<server[:port]>] [/admin] [/f[ullscreen]] [/w:<width>] [/h:<height>] [/public] | [/span] [/edit "connection file"] [/migrate] [/?]

Öffnen Sie einfach ein CMD-Fenster, geben Sie mstsc ein, geben Sie den PC-Namen oder die IP-Adresse ein, klicken Sie auf Optionen und machen Sie Ihren fröhlichen Weg, aber speichern Sie unter... sie haben also eine funktionierende Verknüpfung für später.

 0
Author: Core,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2014-07-09 13:15:10