At first, I found a command like this:
wmic /node:[IP OR Domain] /user:[User] /password:[Password] PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
It kept giving errors, and I couldn't figure out the reason.
After some searching, I roughly understood, and the final command is as follows:
wmic /node:[IP OR Domain] /user:[User] /password:[Password] RDTOGGLE WHERE (__Class!="") CALL SetAllowTSConnections 1
References: