One of those shitty days you do something wrong, I did deactivated RDP from an EC2 Windows Server 2012, so I did had to find a way to get it back since there was data which wasn’t on any backup. After spending a few hours researching I did found something and got it back.
This is what you need to do to activate rdp using regedit.
1. Stop the EC2 instance.
2. Detach the volume.
3. Attach the volume to another instance in the same availability zone.
4. Open disk management and put online the attached drive.
5. Open REGEDIT.
6. Click: HKEY_LOCAL_MACHINE
7. Click: File -> Load Hive
8. Search into the new attached drive the following path: Windows\System32\Config
9. Open SYSTEM file
10. Set KEY NAME as anything you want, example: external-drive
11. Now, place on that folder and look for the following path: external-drive\ControlSet00\Control\Terminal Server
12. Double click on fDenyTSConnection change 1 to 0
13. Do the same on external-drive\ControlSet01\Control\Terminal Server
14. When you do deactivate rdp by mistake like me, firewall will block it too, so we need to deactivate firewall in order to gain access again, doing the following:
Change the value EnableFirewall to 0 on each of the followings just to make sure
14. Unmount the hive, put the drive offline, detach it.
15. Attach it back to the instance and start the instance back again.
16. Don't forget to activate your firewall again.