0

I have problems with the powershell and some ideas.

I would boot a computer in a company network each day on 9 o'clock. For thats i must connect to the company terminal server. After the wakeonlan i must connect on the terminal server per rdp to the client.

How I could do this?

I think I connect to the terminal server over RDP and execute the WOL command. Then i execute the RDP connect command and connect to the client. After five minutes i close the both RDP sessions.

I tried PsExec but thats only allowed in a local server directory.

Patrick
  • 829
  • 2
  • 13
  • 34
  • Just what exactly is your problem? As long as there are open ports that would allow RDP and WOL, there should be no problem in connection "Your PC" -> "TS" -> "Client". Please try to restate or post some details. – AlexPawlak Mar 27 '14 at 19:36

1 Answers1

0

RDP is a graphical/interactive protocol/system. Although it can be done, GUI automation isn't PowerShell's speciality. Try looking into something like AutoIt.

For RDP automation you could try something like this (keep the form hidden), but it's a bad solution and I'm not sure it even works anymore on newer versions of Windows.

Frode F.
  • 52,376
  • 9
  • 98
  • 114
  • I remembered that you could use the rdp "mstsc.exe" with server parameters. For example I could send the command, remember the process and kill the process. Then I would need an bat script which executed on terminalserver on autostart which wakes the client. Something like this... It must work ...! – Patrick Mar 27 '14 at 21:36
  • Not to be rude, but this is automation gone wrong. If you really need to automate WOL + rdp session(don't understand why) to a computer, then you should just run that as a scheduled task on the terminal server. RDP -> TS with script to WOL and RDP to another client.. That's a disaster waiting to happend. – Frode F. Mar 27 '14 at 22:04
  • Where I'm rude? :( -> I cant create WOL Task because i have no permissions in the company network for unattended tasks... But thats a great idea.. CMD which would be executed from remote computer. Then i must only know how to execute commands remotely :S – Patrick Mar 28 '14 at 21:16
  • You weren't rude, I was just starting my comment with something similar to "no offence, but... ". :) – Frode F. Mar 28 '14 at 21:26