logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
MSSMflow  
#1 Posted : Tuesday, September 9, 2014 10:53:54 PM(UTC)
MSSMflow


Rank: Member

Joined: 8/25/2014(UTC)
Posts: 32
United States
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
Jeffrey  
#2 Posted : Thursday, September 11, 2014 4:46:12 AM(UTC)
Jeffrey


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 6/2/2014(UTC)
Posts: 37
Canada

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

MSSMflow  
#3 Posted : Monday, September 22, 2014 2:54:16 PM(UTC)
MSSMflow


Rank: Member

Joined: 8/25/2014(UTC)
Posts: 32
United States
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!
MSSMflow  
#4 Posted : Wednesday, September 28, 2016 6:59:01 PM(UTC)
MSSMflow


Rank: Member

Joined: 8/25/2014(UTC)
Posts: 32
United States
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?
MSSMflow  
#5 Posted : Wednesday, September 28, 2016 7:03:09 PM(UTC)
MSSMflow


Rank: Member

Joined: 8/25/2014(UTC)
Posts: 32
United States
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
Alexander  
#6 Posted : Wednesday, September 28, 2016 7:47:21 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 711
Man
Location: Raleigh, NC

Was thanked: 65 time(s) in 62 post(s)
I believe that's related to this issue.
ScreenConnect Team
KBrownConsulting  
#7 Posted : Friday, September 30, 2016 10:12:19 AM(UTC)
KBrownConsulting


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 3/11/2014(UTC)
Posts: 69
United States

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:

  1. Download the great Run Process As User app that bgeraghty243 created.
  2. Copy the rpau.exe file into the C:\Windows\SysWOW64 directory on the system you want to issue the logoff command to.
  3. 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.
MSSMflow  
#8 Posted : Friday, September 30, 2016 10:21:14 AM(UTC)
MSSMflow


Rank: Member

Joined: 8/25/2014(UTC)
Posts: 32
United States
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.
KBrownConsulting  
#9 Posted : Wednesday, October 5, 2016 10:45:52 AM(UTC)
KBrownConsulting


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 3/11/2014(UTC)
Posts: 69
United States

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.
Users browsing this topic
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.