Windows:Run Task Scheduler with System user

Task scheduler or scheduled task is very important for a system administrator to manage the self design script to monitor from a server.

However, you might found out when you schedule a task from Windows Server 2003 with your used user such as batch file with .bat, you will get a command prompt popped up every time you are performing other task where this is annoyed.

To overcome this problem, I just found out that we can use System user to set the task without worry the above problem and it could solve when you have implement forced password change from a server.

I have come out the solution for Windows Server 2003 and Windows Server 2008.

Windows Server 2003,
With Windows Server 2003, you may look for the scheduled task from Control Panel, and look for Scheduled Task.

If you are creating the new task, just enter the information needed and use the user of “System”(Exactly, case sensitive) as the user.
Note: System or NT AUTHORITY\SYSTEM, where I will use System only where it is easy to remember.

If you are modifying old task, change the user to System and use empty password.

Windows Server 2008,
With Windows Server 2008, go to the Administrative tool and look for Task Scheduler.

When you create the task or modify it, just click the button of “Change User or Group…” and change it to SYSTEM. That all.

Schedule backup for MSSQL to remote computer

If you familiar with MSSQL maintenance plan and ever configured backup through this tool and you should know that to backup the MSSQL database to remote computer, you have to configure Log On setting from services.

Okay, today we assume that we couldn’t allow to change the setting from Log On setting and wish to set the schedule backup, we could use maintenance tool and batch command to schedule it.

Firstly, create a maintenance plan from MSSQL, then select “Back Up Database Task”. From Database(s) option, select your database name, you may specify the directory that wish to backup. From this article we make it to C:\mssql\backup\.

Next, create a batch file named mssql_backup.bat and insert command as below.

xcopy C:\mssql\backup "\\remote_server\c$\backup" /e /i /h /y

Where remote_server is your remote server name and you would like to place it to C:\backup.

Lastly, create Windows Task Scheduler and configure the mssql_backup.bat to run daily or weekly as your wish.