T
T
The_Immortal2020-03-13 00:40:02
Android
The_Immortal, 2020-03-13 00:40:02

Remote non-interactive lock Windows 10 with Android?

I welcome everyone!

You need to lock down a workstation running Windows 10 remotely over the network from an Android device non-interactively (without interfering with the user's work). It would seem that nothing complicated, but in fact the solution could not be found.
I see only two options for connecting to Windows 10:

  • telnet
  • ssh
1. Windows 10 telnet server left. I found a couple of free 3rd party telnet server implementations here:
- HK Telnet Server // is buggy - KpyM Telnet Server // doesn't start properly I.e. with telnet'om span. 2. Windows 10 has a built-in OpenSSH server. However, not a single SSH client (whether from under Windows or from under Android) can execute the command (like ) For some reason, it does not pass through SSH. Actually, the question is: how to solve the designated problem? Thank you!


rundll32.exe user32.dll,LockWorkStationtsdiscon


Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nadim Zakirov, 2020-03-13
@The_Immortal

I could be wrong, but it seems that SSH in Windows works on a virtual Linux, that is, it is useless to give commands to it. Alternatively, try setting up auto-start of all bows from a specific folder, let's say every 10 seconds. Further, if necessary, just mix the desired batch file into this folder via SSH and it will be automatically executed, after which it will delete itself.

T
The_Immortal, 2020-03-13
@The_Immortal

So, I will summarize.
1. Within SSH , it is possible to block Windows using the tsdiscon utility , specifying the local session tsdiscon console.
Despite the fact that SSH provides full access to the console (cmd or PowerShell), it is not possible to call the LockWorkStation function via a command rundll32.exe user32.dll,LockWorkStationthrough the built-in OpenSSH server in Windows 10 (at least through the sshd service), because this function requires a desktop session , and SSH does not start in this session. Prior to Windows 2003 (on Windows XP), the function will work, because there

the local desktop is running in session 0.
Those. before Vista, this command is executed under session 0 - within its framework there were no divisions between RDP, consoles, desktops, services. At the current moment, session 0 is isolated, non-interactive and is supposed to execute services and system processes - unfortunately, the above command falls into this session (and all commands executed via SSH, because their child process is the sshd service ), I understand it this way, but it may be wrong. If anything, here is the source (exactly the same question was raised there).
Probably, somehow you can run the OpenSSH server interactively, but I didn’t figure out how to do it, and it’s not comme il faut to somehow keep the server not within the service.
2. Telnet to LockWorkStationis executed successfully, because telnet works with a desktop session. But the problem is that I did not find an adequate telnet server under Windows 10. There is a possibility that the telnet server was once in some kind of Technical Preview of Windows 10. For example, they write here:
With build 9879 of Win 10 TP , Telnet Server is specifically removed
Those. before build 9879 Win 10 TP telnet server should be. I found build 9841 (<9879) in the open spaces, but I did not find a telnet server there. I also tried to start a telnet server with Windows 8.1, but there are different imports, functions are not detected - such a port will not take off, in general. 3. As advised above, the schedule
option . Those. the necessary script (the same LockWorkStation function ) is executed if there is a particular file in a certain place, the appearance of which can be initialized via the same SSH. 4. Also from the advice above: deploy a web server with a simple CGI and execute a command (the same LockWorkStation ) when a specific URL is called. Thank you all sincerely!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question