Link to home
Create AccountLog in
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.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of sglee
sglee

ASKER

"run the task with highest priviledges" --> it works. Thank you.