Is it possible to logon to the remote machine using Powershell, and to execute scheduled task or batch file, which contains CodedUI tests? I have tried Invoke-Command, but CodedUI test cannot be executed because it has no control over the desktop. Autologon is enabled on the machine, and all I need is to remotely login to it, and execute scheduled task. Is that possible?
Thanks, Ed.
If you need an interactive desktop session, you will need to use RDP or similar. When you create a remote PowerShell session, or use Invoke-Command, you're creating a new session, not connecting to an existing one. And there's no GUI to associate with it.
Related
What is the alternative for running jobs when the hosting company that provides shared SQL Server services blocks access to SQL Server Agent?
All windows machines have a built in tool, "Windows Task Scheduler" which can run jobs on a schedule determined by you. Its an easy tool to learn and you probably will have to run your jobs using SQLCMD.
If you don't have access to agent, then you wont get access to Window Scheduler for sure. Request access to the agent or at least have them create a job for you that runs at a specific time. If not the alternative is pretty ugly.
1.What is purpose of the job to be run by the Agent job?
How often did you want it to run (Schedule) ?
If you can answer those two then maybe, we can have an alternative..
I have an app that needs to run as a GUI, I'm trying to automate it's launch at startup without the need to remote desktop to the windows server 2008 R2 and manually start it. I currently use a powershell script at startup to perform multiple tasks but have not found a way to launch this gui app in the foreground for the user. So for now I still need to remote in and manually kill / start it.
psexec.exe will help you here.
this guy can execute interactively in a remote execution. PowerShell in remoting cannot be used for interactive tasks.
I have a CI environment set up that build my project. It creates a set of sql server files, that i want to to send to my windows server. For that im looking into using scp, by installing copssh.
scp -r /file_in_unix/ user#windows_hostname:/cygdrive/c/
I want to execute a batch file on the windows server, but dont know how to do this?
any ideas?
Quite fast workaround is just to connect your Windows machine to Jenkins as another node. Your current unix job can trigger this job after successful execution.
Lotus Notes scheduled agent that performs an export of data, but not to the notes server, but to a shared location on the network. Any ideas?
I used to do that in two different steps:
Create the file locally on domino server
use a sheduled task or cron job to copy the file to the required network destination
Reason why I wanted to have this splitted is that I was able to create a dedicated user for the scheduled task only. This user has to have the rights to run the task on the domino server as well as write access to the network share. Additionally. the agent won't fail in case of an issue with the connectivity to the network share.
You could map the shared location as a drive (on the server side) and write the file to it.
I have to run a batch job which sits in the windows server from my unix box.
Or from my local machine.
The win server has a userName/Pwd .
How do i programmatically connect to the windows machine and run the batch?
(The batch will change some file permissions in that machine)
Please let me know if there is a better way of handling this situation
A lot of this depends on how you authenticate on the windows machine, the network relation you have to it from your local and unix machine and what level of permission you will need to run the task ons the remote batch file.
I can say that in Windows, you could start by possibly creating a script that stores the username and password needed to connect to the remote machine in a variable, and in that script have it connect to the machine over a network and run the batch as that user.
How woudl you connect to the remote windows server? is it on a LAN or VPN type environment, do you connect with ssh or do you normally map it over the network?>