Getting error while automating the PowerShell file in the task scheduler - windows

I have created a PowerShell file, "File.ps1", and I am trying to automate the execution using the task schedular. As soon as the schedular is running, the PowerShell windows keep popping up but not running the script.
I have changed the execution policy to unrestricted for the script, but it did not solve the problem.

Related

Setup Bootstrap for Visual Basic Setup Toolkit - EXE - silent installation (VB6)

We have an old application which uses has it's executable (EXE) build on VB6 (Setup Bootstrap for Visual Basic Setup Toolkit ). We are trying to silently install the setup by and running it in a scheduled manner using task scheduler.
Command use : Start-Process -FilePath "D:\SETUPXXX.EXE" -Verb runAs -ArgumentList "/qn"
While running this stand alone from a power shell console or command line the setup executes and shows up on the screen , completes installation and goes off(without clicking anything). This installs is successfully.
But wherever we are trying to schedule this on a task scheduler it doesn't pop up anything and neither it installs the application.
We tried other ways "setupxxx.exe /sc:\setup.log" but the results are same it works when executed from command line and pops up the installation completes but fails to do the same when scheduled or run as a batch file.
Is there a way to stop the installer popup coming which might be stopping the instillation while running.
Refer :https://theether.net/kb/100165

Microsoft Azure Backup (MARS) not running from scheduled tasks

We've got several servers running MAR's the lastest version 2.0.9145.0
I can run all backup's manually and its runs without problems. But when i try to run it from scehduled backups it shows in task scheduler that its run but gives this error code:2147942401
If i manually input the arguements into powershell it runs fine. However the task scheduler is not kicking in the backups.
I've altered the permissions to a domain admin, changed PS path to syswow64. So now i'm lost.
Has anyone had similar and any ideas on how to fix it or at least run the commands from a bat file instead?

Starting jenkins Slave agent using Jnlp using Task Scheduler always starts as headless

I am trying to find solution for the jenkins nodes to automatically connect to master in non headleass mode.
Here is what I have done so far
I have written batch script which calls the powershell script. Powershell script has series of commands to start the jenkins slave agent using jnlp.
This batch script is configured in Task Scheduler to run at the startup. The jenkins slave node is connected to master as soon as node starts up.
But execution of GUI test is not visible in the node when the test starts.
When I manually run this batch script from command line, it works fine i.e non headless mode and I can see the execution of GUI test.
I've read few articles about this kind of setup and none worked.
I also wrote a small piece of powershell script to allow a Windows Service to Interact with Desktop. This script runs after the batch script to start jenkins slave agent.
Task scheduler job is configured to Run as Administrator and I login as administrator to see the execution.
Since this batch script is running via Task scheduler I am guessing its running in a different session.
How do I solve it.
Try to put your script into shell:startup.
On a Windows 10 machine with the Jenkins slave under the user you need, press Windows+R (Run...) and type shell:startup and put your script into opened folder. It will run once the user logged in.
This is how you'll see console and any windows it spawns.

how to run batch file with task scheduler with option run whether logged on or not

OS: Windows 10
I'm trying to run a batch file on Windows 10 from the Task Scheduler. I can run the batch file fine if I run it from the command prompt.
If I run it from the Task Scheduler to only run when the user is logged in, the task will run without any issues. However, when it runs when the user is not logged in, the Task Scheduler looks like it's running the file but nothing happens.
I've tried changing the batch file to nothing but the following line to ensure it's not because of what's in the batch file
I run it with higher privilege I allowed the user account to log as a batch file in local security policy
I still hours to fix this issue but still the same problem when I run my batch file manually with option (run whether logged on or not) it will run but nothing happens
My configuration:

Windows task scheduler is not running in Windows server 2012 when trigger option is set as Startup

I have a task scheduler to execute a batch file on windows start up. I have the following setup in task scheduler,
Trigger - At startup
Action - to execute a batch file
Security options - Run whether user is logged on or not
When i reboot the machine, the task is not getting triggered and the status is ready. The same is working fine when i run it on demand.
My scenario is to run the batch file at the system startup (user will not log on to the machine) and the batch file should open a separate command prompt.
The above is working when executing the task on demand and not while during startup.
Following two steps are important
1 Configure for Windows 10 is important
2 Make sure all the checkboxes are unchecked as shown below, this is important
Refer this for more details

Resources