Reference: https://blogs.msdn.microsoft.com/micr...
Script
-----------
#!/bin/sh
#Install EPEL and nux Desktop repository rpms
rpm -Uvh http://li.nux.ro/download/nux/dextop/...
#Install GNOME desktop to get the graphical user interface
yum -y groupinstall "GNOME Desktop" "Graphical Administration Tools"
#command to change the reboot from CLI to GUI
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
#Install the xrdp
yum -y install xrdp tigervnc-server
#start the xrdp service
systemctl start xrdp.service
#enable the xrdp service
systemctl enable xrdp.service