Start Stop services
- sc
[command]
SysInternals
To counter this you can use the following PsExec - http://technet.microsoft.com/en-us/sysinternals/bb897553 (taken from http://serverfault.com/questions/359010/execute-windows-sc-command-as-another-user)
If you want to script using the sysInteranl files then the popUp EULA can cause problems. (It pops up and you have to accept it). One way around this is to add -accepteula to your script
e.g.
pskill -accepteula
Remote Desktop controls
List existing Remote Desktop connections. (Note in the end I ran these on the remote machine in question (after using the mstsc command to login below)
- qwinsta /SERVER:
- rwinsta /SERVER:
dir> qwinsta
SESSIONNAME USERNAME ID STATE TYPE DEVICE
>rdp-tcp#29 myUser 0 Active rdpwd
rdp-tcp 65536 Listen rdpwd
sa507823 1 Disc rdpwd
console 4 Conn wdcon
Here I had a disconnected instance still hanging around. This could be killed using
rwinsta 1
Also to 'force' a login you remoteDesktop command in console mode e.g.
You can run the remote desktop in consoel mode (http://h0w2.blogspot.com/2011/04/how-to-force-go-in-to-remote-desktop.html )
If you need to force, follow this trick :
- From the Start menu click RUN Command
- type mstsc /console /v:nameserver or ip address of remote computer
for example: mstsc /console /v:192.168.0.10
Or
- type mstsc /console /v:nameserver or ip address of remote computer /admin
for example: mstsc /console /v:192.168.0.10 /admin
- Click OK
No comments:
Post a Comment