<p><a href="http://wincert.net/wp-content/uploads/2015/01/windows-server.jpg"><img class="alignnone size-full wp-image-550" src="http://wincert.net/wp-content/uploads/2015/01/windows-server.jpg" alt="Windows Server" width="720" height="340" /></a><br />
After I had permission issues with running a simple batch job on the server even with local administrator permissions and UAC turned off, I had to find another way for running a batch job remotely.</p>
<p>The solution was to use Scheduled Tasks, since it has the option to run the task under highest privileges.</p>
<p>Since this is a backup job, we need to run a scheduled task remotely by running a scheduled task from the batch file, because of the permission issues. sounds confusing, right?<!--more--></p>
<p>To be able to run the scheduled task from a .bat file we will use &#8216;<strong>schtasks</strong>&#8216; command, in this case on Windows Server 2008 R2 machine.</p>
<p>If our scheduled task job name is <strong>BackupTask</strong> and machine name is <strong>SPAN</strong> here&#8217;s how the command should look:</p>
<p><strong>schtasks /run /s \\ServerName /TN &#8220;TaskName&#8221;</strong></p>
<p>or in our case</p>
<p><strong>schtasks /run /s \\Span /TN Backuptask</strong></p>