Thanks to all for the ideas, but I've come to the conclusion that M$ must have tightened security within Win Server 2019, so I went with the file monitor idea... the stored admin credentials would work but seems a bit complicated to maintain for our purposes.
If anyone comes up with a better (simple and secure) method, I'm open to further suggestions.
REM Set up value for the batch file to use
SET WaitFile1=E:\Accounting\_RemoteBatchFiles\TextFiles\EmpExpense_PayListAndImpFile_kmoyes.txt
REM repeated loop, checking for the WaitFile
:CheckForFile
IF EXIST %WaitFile1% GOTO FoundIt1
REM If we get here, the file is not found, so wait a number of seconds and then recheck. 300 = 5 minutes.
TIMEOUT /T 300 >nul
GOTO CheckForFile
:FoundIt1
REM File1 found, so start the batch.
CALL E:\Accounting\VisualCut\BatchFiles\AP_EmployeeExpense-2-PaymentListAndImportFile.bat
REM Delete WaitFile1, which is just a blank text file.
DEL %WaitFile1%
REM Go back to checking for the file.
GOTO CheckForFile
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
------------------------------
Original Message:
Sent: 10-24-2019 08:51
From: Steve Iwanowski
Subject: Remote start scheduled task without admin permissions...?
I've been able to modify the task XML file ACLs in the past (https://www.mysysadmintips.com/windows/clients/576-allow-to-view-and-run-scheduled-tasks-without-admin-rights) but I think Microsoft fixed that loophole in 2012 R2 or 2016.
You could use PowerShell to store the admin credentials under the user's login just on their PC (https://www.jaapbrasser.com/quickly-and-securely-storing-your-credentials-powershell/), so the only exposure is that user from that device, but it is a security hole.
I think your folder-watcher idea is probably your best bet.
------------------------------
Steve Iwanowski, NextStep Technology Advisors, aka DSD Lancaster PA ¯\_(ツ)_/¯
------------------------------
Original Message:
Sent: 10-23-2019 09:50
From: Kevin Moyes
Subject: Remote start scheduled task without admin permissions...?
Thanks for the reply George.
We want the Scheduled Task to run as a specific admin account on the server, started remotely by a non-admin user. That is the reason I'm using the PowerShell script to start a scheduled task, instead of directly triggering a set of commands.
I have a technique to monitor for a specific file, and running steps if it is found. That is my backup plan, since it doesn't require any user permissions beyond being able to create a file in a server share, simple, secure and easy to configure but the monitoring task must run repeatedly. I've read PowerShell "should" be able to do what I want directly though, without such a work-around, and I'm not ready to give up yet.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
Original Message:
Sent: 10-23-2019 01:30
From: George Khairallah
Subject: Remote start scheduled task without admin permissions...?
Do you require the script to be run AS that user? or you just want to allow the non-admin user to run that task?
If it's the latter, then typically, the way I get around this issue is as follows:
- I create an account (in AD, or Local), and make it admin. No one would have the credentials to it.
- I would then write the script I want in Powershell/Kixtart/AutoIT, all of which, with the right tools can be ran as an alternate user, and compiled into an EXE, so all credentials would be obfuscated (not fool-proof, but good enough for most)
If that is along the lines of something that might work for you, and you need more details, please let me know, and I can elaborate on whichever method.
An example of the above that I use this technique for is to allow non-admin users to be able to launch the Starship Server Manager (which isn't launchable by a regular user). Works a treat.
------------------------------
George Khairallah
CTO | gotomyerp, LLC
george.k@gotomyerp.com | 877-888-5525
http://gotomyerp.com/