Avatar of sglee
sglee
 asked on

Scheduling Stop/Start Routing and Remote Access

Hi,
 
 I have Windows 2012 Server and Routing and Remote Access service stops at time for no good reason.
 So instead of troubleshooting the issue, I decide to run a scheduled task to stop/start RRAS service every hour or day using a batch file "Restart-RRAS.bat" with two commands
net stop remoteaccess
net start remoteaccess

But I learned that I could not run it in normal command window. Rather I have open "Command Prompt(Administrator)" to run these commands. I also learned that I could use RUNAS command like:
RUNAS /netonly /user:vpn\administrator cmd, but the problem is that I have to store password in a text file which I don't want to do.

Is there a better solution?

Thanks.
Remote AccessWindows OS

Avatar of undefined
Last Comment
sglee

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
David Johnson, CD

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
sglee

ASKER
"run the task with highest priviledges" --> it works. Thank you.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy