 Rank: Member Joined: 8/25/2014(UTC) Posts: 32  Location: New York
|
So I have a few "unattended" workstations I manage. They are actually user machines attached to equipment. Sometimes my users forget to logoff the domain when they are done. I want to use the command window to send a logoff command. I've tried shutdown.exe /l /f Which works perfectly at the workstation, but when I try it through ScreenConnect Command window, I get: Administrator 09-09 18:42:52 shutdown.exe /l /f
Guest 09-09 18:42:53 C:\Windows\system32>shutdown.exe /l /f FCSRF-IMI5L: Incorrect function.(1) Any suggestions to do what I wanna do? -cbb
|
|
|
|
 Rank: Advanced Member Medals:  Joined: 6/2/2014(UTC) Posts: 42  Thanks: 2 times Was thanked: 5 time(s) in 5 post(s)
|
Try the command: logoff 1 The commands do not run in the same session as the user which is why the other command will not work as intended. Using the logoff command, you can specify the session you wish to logoff. "logoff 1" should work most of the time unless there are multiple sessions on the machine. Edited by user Thursday, September 11, 2014 4:47:19 AM(UTC)
| Reason: grammer
|
|
|
|
 Rank: Member Joined: 8/25/2014(UTC) Posts: 32  Location: New York
|
Ah!
Finally got around to trying. I had a machine locked by a walkaway user.
Sent "Logoff 1" and about three minutes later the user was forcably logged off!
I'll check my log files later to see if it was recorded or not, but that is a useful tool.
Cheers!
|
|
|
|
 Rank: Member Joined: 8/25/2014(UTC) Posts: 32  Location: New York
|
Bumping this to the top.
Since upgrading to Version 6 the "logoff 1" trick no longer works.
Any input on the programmers side why?
|
|
|
|
 Rank: Member Joined: 8/25/2014(UTC) Posts: 32  Location: New York
|
Actually, it seems to be a Win32 versus Win64 issue.
ON 32 bit machines commands like "query user" and "logoff 1" work, but on Win64 machines they return an error:
C:\Windows\system32>query user 'query' is not recognized as an internal or external command, operable program or batch file.
Maybe because Screenconnect is running as the "system32" user?
Any tips?
-cbb
|
|
|
|
 Rank: Administration Medals:  Joined: 7/23/2013(UTC) Posts: 715  Location: Raleigh, NC Was thanked: 66 time(s) in 63 post(s)
|
|
ScreenConnect Team |
|
|
|
 Rank: Advanced Member Medals:  Joined: 3/11/2014(UTC) Posts: 70  Thanks: 13 times Was thanked: 8 time(s) in 5 post(s)
|
While I really hope ScreenConnect will resolve the issue that Alexander mentioned, the following is a bit of a crude workaround for the logoff specific issue: - Download the great Run Process As User app that bgeraghty243 created.
- Copy the rpau.exe file into the C:\Windows\SysWOW64 directory on the system you want to issue the logoff command to.
- From now on the following command can be used from ScreenConnect command window to log off the active user: rpau "cmd.exe" "/c shutdown -l"
I've tested & confirmed it works on 64bit versions of both Windows 7 & 10.
|
|
|
|
 Rank: Member Joined: 8/25/2014(UTC) Posts: 32  Location: New York
|
Actually a quicker workaround is simply to copy the needed utility exe from the real system32 folder to the syswow64 folder.
Then the ScreenConnect client can "see" the exe in the fake system32 folder and run.
Tested and confirmed.
But it is a manual action to copy. You must take graphical control of the target machine.
|
|
|
|
 Rank: Advanced Member Medals:  Joined: 3/11/2014(UTC) Posts: 70  Thanks: 13 times Was thanked: 8 time(s) in 5 post(s)
|
Except that the original example was about logging off the local user using the "shutdown.exe /l" command and even though shutdown.exe is included in the SysWOW64 directory the command doesn't work. So for that particular example using something like rpau.exe is necessary. And you can actually get rpau.exe onto the system without having to take remote control of the system by hosting the file somewhere online and then downloading it to the machine by pasting a command like the following into the command window: Code:
#timeout=30000
powershell (New-Object Net.WebClient).DownloadFile('https://dl.dropboxusercontent.com/u/1025479/rpau.exe', '%SYSTEMROOT%\System32\rpau.exe')
Notes: - A fast & easy place to host the file is in the public folder of a dropbox account you control. (Which is what I've done in the example above.)
- The command example I've provided above should actually work (until I take the file out of my dropbox which will happen sooner or later) but I recommend you host the rpau.exe file somewhere yourself anyway.
Next, in case you haven't already seen it, I've found a way to directly access the true System32 directory from the SC command window which I've described over here.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.