→ Celebrate SysAdmin Day 2024 with Lansweeper Enter our Giveaway here

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CeleroAdmin
Engaged Sweeper
Hi,

I'm trying to deploy a batch file on a handful of computers over WAN. The file executes to stop the Windows Update Service. The batch file needs to run with elevated permissions in order for it to work successfully. After reviewing a number of similar posts, it seems that LanSweeper does not yet support the "Run as administrator" function.

I was wondering if anyone is aware of a workaround that I can add into my deployment steps for the .bat file to run successfully.

Cheers,
CeleroAdmin


1 ACCEPTED SOLUTION
Bart_E
Lansweeper Employee
Lansweeper Employee
When deploying using the scanning credentials, Lansweeper should already use administrative privileges to run the task. In some cases, UAC (User Account Control) needs to be disabled on the target computer as this can cause some issues. You could also use some different methods as mentioned here, but this is not something we can provide support for.

View solution in original post

3 REPLIES 3
Shawn_Heydorn
Engaged Sweeper
:Prompt to Run as administrator
Set "Variable=0" & if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
fsutil dirty query %systemdrive% >nul 2>&1 && goto :(Privileges_got)
If "%1"=="%Variable%" (echo. &echo. Please right-click on the file and select &echo. "Run as administrator". &echo. Press any key to exit. &pause>nul 2>&1& exit)
cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%Variable%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs" & exit

:(Privileges_got)
Bart_E
Lansweeper Employee
Lansweeper Employee
When deploying using the scanning credentials, Lansweeper should already use administrative privileges to run the task. In some cases, UAC (User Account Control) needs to be disabled on the target computer as this can cause some issues. You could also use some different methods as mentioned here, but this is not something we can provide support for.
bbeavis
Engaged Sweeper III
Bart.E wrote:
When deploying using the scanning credentials, Lansweeper should already use administrative privileges to run the task. In some cases, UAC (User Account Control) needs to be disabled on the target computer as this can cause some issues. You could also use some different methods as mentioned here, but this is not something we can provide support for.


Doesn't deployment use the Task Scheduler? There is a checkbox in a scheduled task to run the task elevated. It has been there for a long time. I believe it is called "Run with Highest Privileges". Why not offer that option on the deployment page?

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now