Remote Execution of Scheduled Tasks...

Discussion and support for the Windows family of operating systems.
Post Reply
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Remote Execution of Scheduled Tasks...

Post by Anakha56 »

Greetings All,

Not sure how to word this so bear with me ;).

Here at our company we use a Windows PC to do all our announcements eg: for when its tea&lunch, delivery cycles and quite a few other announcements. Now we have been tasked to change quite a few of these announcements and have the ability for the Receiving department to change the announcements based on the overtime requirement. So the idea is to have three batch files: normal, 1HR overtime & 2HR overtime and for the member in another office in the Factory to be able to execute these batch files that will change the Scheduled Tasks on our announcement box. So the question is, can this be done? What am I looking at when doing this?

Thanks for any help, and if any, different suggestions ;).
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: Remote Execution of Scheduled Tasks...

Post by rustypup »

there's this handy little tool called stuxnet....

what, exactly, do these tasks achieve? (i'm guessing change some form of displayed message elsewhere?)

<edit to elaborate>
are the tasks simply feeding into another event system or changing the messages directly
</edit>
Most people would sooner die than think; in fact, they do so - Bertrand Russel
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

The tasks play audio files that are launched at timed intervals.
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: Remote Execution of Scheduled Tasks...

Post by rustypup »

2003 included a simple "remote" command which would allow you to manipulate a running batch file but it was.. dinky and fiddly and not very secure...

schtasks is probably what you're after though...
Most people would sooner die than think; in fact, they do so - Bertrand Russel
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

Thanks will look into it :).
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

rusty need to pick your juicy brain over this...

From what I have researched you would need to use a combination of winrs & schtasks. So I have setup winrs using this guide: http://blog.hviidnet.com/category/code- ... line-tips/ . The system I am running this all on is a Windows 7 Professional PC so it should work. Near as I can tell my command should go something like this:

Code: Select all

winrs -r:<insert PC name> schtasks.exe /Change /S "<specify the system>" /U "<user>" /P "<password>"]]]] /TN <task name> /ENABLE
However I keep getting "Access Denied" messages. I have disabled the UAC and even tried this: http://social.technet.microsoft.com/For ... 8a67d9316/ but still cant get any further. Can you see anything wrong in my command?
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

Seem to have worked out why the execution is failing, my account is not a domain admin. Making a change in the Group Policy for just that one machine to allow for remote management did not solve the issue either. Need to figure out what level of rights I can get away with without using domain admin, any ideas?
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
User avatar
hamin_aus
Forum Moderator
Posts: 18363
Joined: 28 Aug 2003, 02:00
Processor: Intel i7 3770K
Motherboard: GA-Z77X-UP4 TH
Graphics card: Galax GTX1080
Memory: 32GB G.Skill Ripjaws
Location: Where beer does flow and men chunder
Contact:

Re: Remote Execution of Scheduled Tasks...

Post by hamin_aus »

Anakha56 wrote:Need to figure out what level of rights I can get away with without using domain admin, any ideas?
Use your domain admin account :P

You could try making the account you want to use a local admin on the remote machine?
Image
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

Local admin does not work as well. :(

Today will be about making my account be a member of just about everything and seeing what works and what does not work. Going to be a long day...
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
User avatar
hamin_aus
Forum Moderator
Posts: 18363
Joined: 28 Aug 2003, 02:00
Processor: Intel i7 3770K
Motherboard: GA-Z77X-UP4 TH
Graphics card: Galax GTX1080
Memory: 32GB G.Skill Ripjaws
Location: Where beer does flow and men chunder
Contact:

Re: Remote Execution of Scheduled Tasks...

Post by hamin_aus »

Anakha56 wrote:Local admin does not work as well
Image
Image
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

:lol: I am making slight headway. Some Googling revealed this nugget:

http://social.technet.microsoft.com/For ... 683678a2f/
How does your command look like? Do you use winrm, winrs, or PowerShell Remoting?
The non-admin user needs to either be added to the default SDDL (winrm\Config\Service\RootSDDL), or to the SDDL for the resource URI in question. The SDDL for that resource URI is stored as a part of the plugin-specific configuration (e.g. Microsoft.PowerShell plugin).
Set-PSSessionConfiguration Microsoft.Powershell -ShowSecurityDescriptorUI command is modifying the SDDL for Microsoft.PowerShell plugin, but not the RootSDDL.
I am hoping that this will work with winrs so I dont have to touch powershell but I am currently busy on something else right now. Will only find out if it works at about 10am...
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

jamin_za wrote:
Anakha56 wrote:Need to figure out what level of rights I can get away with without using domain admin, any ideas?
Use your domain admin account :P

You could try making the account you want to use a local admin on the remote machine?
My apologies hamin! I misread your post completely, I owe you a beer or 5 ;). Adding the user to the local admin group solves the issue, going to try demote the account to Power User and see if that still works. Also needed to change my command structure since my one kept on returning the error:
ERROR: User credentials are not allowed on the local machine.
Change the command to look like this:
winrs -r:<insert computer name> schtasks.exe /Change /TN "<insert task name>" /Enable /ru ""
Worked. Now to create 6 batch files each containing 12 commands to either disable or enable tasks. Hard part over, tedious part begins...
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
Anakha56
Forum Administrator
Posts: 22136
Joined: 14 Jun 2004, 02:00
Processor: Ryzen 1700K
Motherboard: Asus X370
Graphics card: Asus 1060 Strix
Memory: 16GB RAM
Location: Where Google says

Re: Remote Execution of Scheduled Tasks...

Post by Anakha56 »

Bugger new problem... :/

When running the batch file I get this error now:
ERROR: Invalid syntax. '/Change' option is not allowed more than '1' time(s).
Anyone know of a way to add a pause in between each line so it treats each command as a separate one?

*edit*

Fixed, added a & at the end of each line and its running :).
JUSTICE, n A commodity which is a more or less adulterated condition the State sells to the citizen as a reward for his allegiance, taxes and personal service.
User avatar
hamin_aus
Forum Moderator
Posts: 18363
Joined: 28 Aug 2003, 02:00
Processor: Intel i7 3770K
Motherboard: GA-Z77X-UP4 TH
Graphics card: Galax GTX1080
Memory: 32GB G.Skill Ripjaws
Location: Where beer does flow and men chunder
Contact:

Re: Remote Execution of Scheduled Tasks...

Post by hamin_aus »

Well done :thumbright:
Image
StarBound
Registered Pervert
Posts: 6879
Joined: 30 Jul 2004, 02:00
Processor: Intel i7 4790k
Motherboard: MSI Z97 Gaming 7
Graphics card: MSI GTX780Ti Gaming
Memory: G.Skill Sniper 1866mhz 16GB
Location: The Greater Unknown
Contact:

Re: Remote Execution of Scheduled Tasks...

Post by StarBound »

So remote execution has nothing to do with killing someone in china from sa?

/walks away disappointed
My Steam Screenshots

I lived the dream ...then my PC died.
Post Reply