Retrieve IP Address That We already RDP in our Machine

Mohamad Azmi Mat Hassan 21 Reputation points
2020-12-23T13:06:34.98+00:00

Hi Everyone, I hope you all doing well. I just want to ask how can we extract IP address that we have RDP before?

For Example: User ABC try RDP to a server (10.XX.XX.XX) using his laptop - (So, where we can find history of IP Address (10.XX.XX.XX) RDP in Laptop A? )

I already try google and I found out all IP address that we have been RDP were log into this registry path location as below:

"HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers"

I wonder how to extract all of the IP Address into text file or .csv

Thank You.

Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Andrew Wealleans 76 Reputation points
    2020-12-23T15:54:29.223+00:00

    The below will export the keys created by RDP to csv

    $exportfile = "C:\temp\RDPhistory.csv"
    $RDPhistory = Get-childitem 'HKCU:\SOFTWARE\Microsoft\Terminal Server Client\Servers'
        $RDPhistory | Foreach-object {Get-ItemProperty $_.PsPath } | select-object PSChildName | export-csv -path $exportfile -NoTypeInformation
    

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-12-23T14:23:39.29+00:00

    Some ideas here.
    https://gallery.technet.microsoft.com/scriptcenter/site/search?query=export%20registry%20key&undefined=undefined&ac=3

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

  2. Anonymous
    2020-12-24T03:13:28.413+00:00

    Hi,

    Please try below command in CMD. (run as administrator)

    reg export "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal Server Client\Servers" C:\exportip.txt && type C:\exportip.txt | findstr /i "key"

    50965-image.png

    Thanks,
    Eleven

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it. Thanks.

    0 comments No comments

  3. Mohamad Azmi Mat Hassan 21 Reputation points
    2020-12-26T04:09:48.303+00:00

    Thanks All,

    I have found answer from @Andrew Wealleans . I hope this thread may help others also :)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.