Run Scipt AS Administrator in Windows 10

RS
Randy, Saputra
PT. SATYA AMARTA PRIMA

Hi everyone,

Recently i tried to send script via Package to desktop/laptop running on Wins 10 Pro (Enroll to SOTI with Windows Modern Agent).

One script I try to send is Turnoff firewall script. The script will running only if run it as administrator. How to do that with SOTI? if i send the script through package, the script just only show up at the device but the user need to right click on it and run it as admin to execute the script.

Hope someone can give an insight.

Thanks & regards,

Randy

5 years ago
Windows
ANSWERS
JD
John Doe
5 years ago

Current Workaround for me, though its not ideal for security is the following:

Create a Task that runs at startup that will always try to execute c:\script.cmd

Set the Task to be run as Admin with highest privileges.

When you need to run something as admin compile a package with needed things and place it in "script.cmd" then push it to the device with a Profile / Package and restart.

After the restart of the Device the Script gets run, for this to work properly and to not run the batch every single time, programm the batch to delete its self if everything was run correctly.