Monday, May 17, 2021

Enable RDP, Ping, File sharing, remote registry and allow it through firewall from cmd line

REM
REM ENABLE RDP
REM
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="remote desktop" new enable=yes
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP" /v UserAuthentication /t REG_DWORD /d "0" /f  
REM
REM SET REMOTEREGISTRY SERVICE TO AUTO START AND START IT
REM
sc config remoteregistry start=auto
wmic service where "name = 'remoteregistry'" call startservice

REM install Telnet client dism /online /Enable-Feature /FeatureName:TelnetClient REM
REM
REM ENABLE FIREWALL
REM
netsh Advfirewall set allprofiles state on

REM
REM ENABLE FILE SHARING
REM
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes

REM
REM ENABLE ICMP PING REPLY
REM
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
REM Disable 'Fast Boot'
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f

No comments:

Post a Comment

DiskGenius and Hasleo Backup

DiskGenius is an all-in-one utility for disk partition management, OS migration and file recovery. https://www.diskgenius.com/ Hasleo offers...