hengi
asked on
How to logoff user form a Win 7 client per command remote?
Hello Experts,
which command can a domain-admin use to logoff remote a user from a Win7 64 bit client?
Under WinXp "PsShutdown -o -f \\Client" worked fine but under Win7 not.
The attempt "PsExec \\Client shutdown -l" doesn't work too.
Many thanks for your help in advance.
which command can a domain-admin use to logoff remote a user from a Win7 64 bit client?
Under WinXp "PsShutdown -o -f \\Client" worked fine but under Win7 not.
The attempt "PsExec \\Client shutdown -l" doesn't work too.
Many thanks for your help in advance.
psexec \\computername cmd
shutdown -f -s -t "00"
Works for me..
It's one extra step but it does work..
shutdown -f -s -t "00"
Works for me..
It's one extra step but it does work..
Type
rwinsta /?
rwinsta /?
shutdown with -s will turn off the computer
the author asked for log off only
the author asked for log off only
Oh my bad, misread it.. Thanks Seth..
ASKER
Dear Seth,
unfortunately shutdown -l doesn't work together with -m \\client.
Dear Rob,
a shutdown or a reboot works with "psesxec \\client shutdown -s" or "psesxec \\client cmd shutdown -s" and also with "psshutdown -s \\client". But all commands don't work with the flag only to logoff the user without reboot or shutdown. The command "psexec \\client cmd shutdown -l" returns "Forbidden function.(1)" and the command "psshutdown -o \\client" returns "Console logoff initiated on client." but nothing happens.
unfortunately shutdown -l doesn't work together with -m \\client.
Dear Rob,
a shutdown or a reboot works with "psesxec \\client shutdown -s" or "psesxec \\client cmd shutdown -s" and also with "psshutdown -s \\client". But all commands don't work with the flag only to logoff the user without reboot or shutdown. The command "psexec \\client cmd shutdown -l" returns "Forbidden function.(1)" and the command "psshutdown -o \\client" returns "Console logoff initiated on client." but nothing happens.
Hengi,
Does shutdown /L work?
instead of shutdown -l ?
Does shutdown /L work?
instead of shutdown -l ?
ASKER
Dear McKnife,
RESET SESSION SessionName /SERVER:client returns "Error: 1722 The RPC-Server is not available."
I thought this command would be for TerminalServices.
RESET SESSION SessionName /SERVER:client returns "Error: 1722 The RPC-Server is not available."
I thought this command would be for TerminalServices.
Wait! Terminal services?
Why don't you just use the Terminal server manager console?
If you don't have it, download the admin tools for windows 7 and call it a day..
Why don't you just use the Terminal server manager console?
If you don't have it, download the admin tools for windows 7 and call it a day..
ASKER
Dear Rob,
unfortunately "shutdown /L" doesn't work too. I get the same Error "Forbidden function.(1)".
unfortunately "shutdown /L" doesn't work too. I get the same Error "Forbidden function.(1)".
http://www.microsoft.com/en-us/download/details.aspx?id=7887
If this is a Terminal service environment,
just use the admin tools..
I thought this was for just random desktops on your network..
Alternately,
You can use group policy to force that clients only be allowed to log off, vs disconnect, which might help your cause..
If this is a Terminal service environment,
just use the admin tools..
I thought this was for just random desktops on your network..
Alternately,
You can use group policy to force that clients only be allowed to log off, vs disconnect, which might help your cause..
ASKER
Dear Rob,
no sorry this is not a TerminalServerSession. It's a normal Win 7 Client with a interactive login from a user.
no sorry this is not a TerminalServerSession. It's a normal Win 7 Client with a interactive login from a user.
rwinsta is not only for terminal servers/terminal sessions but for any session type on any windows OS.
If it does not work, then you either have no network connectivity to execute remote commands (firewall?) or you don't use an account that is member of the admin group of the remote system - or both.
If it does not work, then you either have no network connectivity to execute remote commands (firewall?) or you don't use an account that is member of the admin group of the remote system - or both.
ASKER
Dear MacKnife,
ok, I thought rwinsta is for terminal server/terminal sessions. Good to know, that not. A domain-admin account, which is member of the loacal administrator group of the remote client, tried this command but got an error: "Error: 1722 The RPC-Server is not available." Other remote commands work, so I think it can't be the Firewall or use this command a special port?
ok, I thought rwinsta is for terminal server/terminal sessions. Good to know, that not. A domain-admin account, which is member of the loacal administrator group of the remote client, tried this command but got an error: "Error: 1722 The RPC-Server is not available." Other remote commands work, so I think it can't be the Firewall or use this command a special port?
"Other remote commands work" - for example which command works, if I may ask?
ASKER
Dear McKnife,
For example: PsKill, PsLoggedon, PsList, PsPasswd, PsService, ... and also PsShutdown but this command only for reboot and shutdown the client
For example: PsKill, PsLoggedon, PsList, PsPasswd, PsService, ... and also PsShutdown but this command only for reboot and shutdown the client
Those mentioned use RPC as well, I wonder why qwinsta should fail then while those work.
Please see what ports are open. Test with telnet:
telnet targetsystem 445
telnet targetsystem 135
If the screen goes black, the port is open.
Please see what ports are open. Test with telnet:
telnet targetsystem 445
telnet targetsystem 135
If the screen goes black, the port is open.
ASKER
Dear McKnife,
both commands return "connection failure". In the firewall port 135 and 445 are allow for the domain.
both commands return "connection failure". In the firewall port 135 and 445 are allow for the domain.
You mean, at the targetsystem, 135 and 445 are both allowed for incoming connections in the firewall profile "domain"? That would mean, something in between is blocking the access, another firewall.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
does that work?