Podcast client with scheduler? - scheduled-tasks

Can anyone suggest a Windows podcast client that includes a scheduler that restricts the hours during which podcasts will be downloaded?

I haven't found a client with a scheduler, but gpodder has a command line version (gpo) that can be run with the Windows Task Scheduler (or cron on *nix systems). For the energy conscious, Wake On Standby can be used to wake a Windows computer from sleep or even hibernate (assuming your bios supports it - pretty common in anything less than about 10 years old).
As far as I can tell, gpo will accept only a single command on the command line, so you'll need to write a script/batch file with the update and download commands. Redirecting input from a file doesn't seem to work.

Related

Running Windows Powershell script always from task scheduler

This might be a very basic question. I have FileWatcher script in windows powershell which I want to run always so that it keeps watching a particular location for files. when I run it from Windows Powershell IDE its run perfectly fine. I understand that I can schedule a task in windows task scheduler for that but what's happening is that the task runs and then comes back in "Ready" status. This is NOT working. I think it should be in "Running" state always. I might be missing something. Please kindly help with your valuable suggestions.
You can do this with TaskSchedule…
Running PowerShell scripts as a “service” (Events: Prologue)
but this is also what permanent Event Subscriptions are for or setting up as user10675448 suggest, make it a real service.
How to run a PowerShell script as a Windows service
Windows PowerShell - Writing Windows Services in PowerShell
This article presents the end result of that effort: A novel and easy
way to create Windows Services, by writing them in the Windows
PowerShell scripting language. No more compilation, just a quick
edit/test cycle that can be done on any system, not just the
developer’s own.
There is also this approach...
PowerShell and Events: Permanent WMI Event Subscriptions
Unlike the temporary event, the permanent event is persistent object
that will last through a reboot and continue to operate until it has
been removed from the WMI repository.
There are multiple ways of setting up the WMI events and I will be
covering 3 of those ways (as they deal with PowerShell) in this
article.

Reliable access to locked remote computer

What I have: I have Windows 7 on my home PC.
What I'm trying to do: I'm trying to keep TeamViewer running at home so I can always get to my home computer. The other day it got completely messed up and would not let me connect but everything else on the PC was just fine.
Items I've looked at:
I looked at this thread and it does not seem to apply to what I need:
Is it possible to start Teamviewer, to accept connections, from commandline?
... but it does not appear to be what I'm looking for.
I have looked at this:
https://serverfault.com/questions/48600/how-can-i-automatically-restart-a-windows-service-if-it-crashes
... and to test the script at the above URL, I stopped a service on my computer and pointed the above vbs script to that service and the vbs script will not restart that service, so that's not working.
What's happening:
From time to time on my home computer, TeamViewer hangs or gets messed up in some way and I cannot connect to my home computer. The last time this happened, the TeamViewer UI was still running but there was a little red dot next to the tray icon and the id numbers and password were blank in the UI so I had to right click and kill it and restart the computer and all was OK.
What I'd like to do:
Is there a way I can run some kind of script or something that will completely kill all TeamViewer processes and services and restart it completely? I'd like to schedule this type of activity once an hour so I can be assured of pretty much always being able to get into my home computer or else just wait an hour and it should be back up and available?
I have 20 years in IT with networking background, databases, GUI development, website development, hardware and software installation but no experience in brain surgery. I've given it a good try but am now asking for some help.
Thanks.
I think that task scheduler, taskkill and batch script is your friend here.
create a batch file to stop any current team viewer process and then restart it.
crate a batch file something like:
taskkill /IM TeamViewer.exe
start "" "C:\Program Files (x86)\TeamViewer\TeamViewer.exe"
(substitute the path to TeamViewer.exe on your own machine).
Then create an hourly scheduled task to run the script using the highest privileges (using Windows Task Scheduler).
Lookup taskkill for more info on killing tasks from the command line.
Just to add that you'll have to have the PC in a associated in your teamviewer account in a group (e.g. My Computers) and use the same account to connect - otherwise the password change on restart will prevent you connecting (you won't know the new password).

Powershell scripting

I want to automate test using powershell. I want to write a script to shutdown the computer, wait for 3minutes and then power on the computer. Is it possible using Powershell? I know that reboot is possible, but I want the system to remain in shutdown stage for 3min and then power on.
If you mean a "real computer" (not a Virtual Machine) so it's not possible. But you can achieve that using Virtual Machine setup. Take look at this documentation: https://technet.microsoft.com/en-us/library/hh848589.aspx
You can shutdown computer with Stop-Computer command
Wait with Start-Sleep
But to poweron PC you need something more complex, take a look at WOL. However there are some difficulties:
It would work only with PCs that allow to be awakened with magic packets
You need to know MAC-address of machine
Target machine should be in the current network subnet of the caller.

Powershell script to keep computer awake remotely

My colleagues and I work in a global business environment that requires us to do software rollouts after staff leaves (to reduce productivity impact) and what is frequently happening is that due to our power settings that I have no power to change, machines are going to sleep about 15 minutes after they leave the office and I still need to access them. They don't receive or install the SCCM package I send because they are asleep. Wake on LAN is not an option because of the hardware variety we have
What would be the easiest way in Powershell to batch keep several machines (possibly 200+) awake? And not bring down our network while doing it? I'm looking to create a script and I would prefer not to have to push it to the machine but rather do it remotely.
UPDATE:
So far one of my co-worker's solution was to run a wait command in CMD remotely for a specified time inside but I don't know if that would keep it awake? What constitutes "activity" as far as power management is concerned?
I hate to say it, but I'm not sure you can given how tightly your hands are bound and your druthers.
One semi-remote solution would be to push out a scheduled task to your client computers. You can specify the Wake the computer to run this task option on the Conditions tab. The Action could run a script silently from a network share, display a message, etc. What it actually does isn't likely very important, though the script could be coded to do something you find useful in your org.
Set the other settings creatively and securely enough and off the top of my head I can't think of any glaring security issues.
Here is 3 easy steps on how to create batch file app clicker to keep your windows 10 awake for as long as you want.
1 - Install Java JDK download link: https://www.oracle.com/ca-en/java/technologies/javase-downloads.html
2- copy paste the following code in a notepad and save it as CLICKER.JAVA in your drive like C:\CLICKER.JAVA
import java.awt.*;
import java.awt.event.InputEvent;
public class clicker {
public static void main(String[] args) throws Exception{
Robot robot = new Robot();
while(true){
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.delay(60000);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
}}}
3- Open another notepad and copy past the following commands and save this file as batch file into your Desktop such as AWAKE.BAT
#echo off
mode con: cols=50 lines=10
#echo Started. Press CTRL+C few times to quit.
#echo off
set root=C:\Program Files\Java\jdk-16.0.1\bin
cd %root%
java "c:\start.java"

Application Deployment with Powershell

I've developed a Powershell script to deploy updates to a suite of applications; including SQL Server database updates.
Next I need a way to execute these scripts on 100+ servers; without manually connecting to each server. "Powershell v2 with remoting" is not an option as it is still in CTP.
Powershell v1 with WinRM looks the most promising, but I can't get feedback from my scripts. The scripts execute, but I need to know about exceptions. The scripts create a log file, is there a way to send the contents of the log file back to the "client" (the local computer making the remote calls)?
Quick answer is No. Long version is, possible but will involve lots of hacks. I developed very similar deployment script/system using PowerShell 2 last year. The remoting feature is the primary reason we put up with the CTP status. PowerShell 1 with WinRM is flaky at best and as you said, no real feedback apart from ok or failed.
Alternative that I considered included using PsExec, which is very much non-standard and may be blocked by firewall. The other approach involves using system management tools such as MS's System Center, but that's just a big hammer for a tiny nail. So you have to pick your poison...
Just a comment on this: The easiest way to capture powershell output is to use the start-transcript cmdlet to pipe console output to a file. We have a small snippet at the start of all our script that sends a log file with the console output from each script to a central file share, and names the log file with script name and date executed so that we'll have an idea of what happened. Its not too hard to pipe all those log files into a database for further processing either. Probably won't seolve all your problems, but would definitely help on the "getting data back" part.
best regards,
Trond