How can I turn off an Android phone in the same Ethernet remotely using a Windows computer?
Shutdown as a command requires root
The simple answer is you can't perform a shell command from within an app for shutdown an Android system unless your device is rooted.
For performing the shutdown command on Android special permissions are required. When triggering a shutdown via UI the command is internally forwarded to a component that has the permissions to shutdown the system.
But regular apps (and therefore this applies also to all processes like telnet or ssh started in the context of an app) don't have this permission and thus can't shutdown the system.
Workaround: shutdown via adb over IP
Executing the command shutdown -p via adb should power off your phone.The problem is that adb by by default only available via USB connection (if you have enabled developer options and adb). The only workaround would be to connect your phone after booting to a PC and enable adb access via IP. This would be then allow a sort of telnet (via &quot;adb connect IP&quot; instead of telnet).
Warning: ADB over IP is really equivalent to telnet which means that it's data  is transmitted totally unprotected in plain text on network level. Therefore you should use adb over IP only in safe networks.
See also this question: How can I shutdown my Android phone using an adb command?