Friday, May 17, 2013

Scheduled Tasks - Error 0x80070569: Logon failure

I was wondering why some scheduled tasks has not sent notification emails this morning.  I connected to my remote server and checked the scheduled tasks services log.  It has several entries similar to this:
"Daily-Powershell-Get-BackupFileCount.job" (powershell.exe) 12/8/2010 12:15:00 AM ** ERROR ** The attempt to log on to the account associated with the task failed, therefore, the task did not run. The specific error is: 0x80070569: Logon failure: the user has not been granted the requested logon type at this computer. Verify that the task's Run-as name and password are valid and try again.
A quick Google search turned up this link:
http://www.chicagotech.net/Q&A/windows1.htm
Their suggestion was:
To fix the problem, grant the local Administrators group the Right to log on as a batch job. e.g.: go to Administrative tool > Local security policy > Local Policies > User Rights Assignment > Logon as a batch job > Add.
NOTE: This behavior occurs even if you are logged on to the Domain Controller as an administrator.
After our system admin on that domain made the policy change I ran a quick gpupdate /force and it took care of the issue.

Sunday, May 5, 2013

Batch Files to Restart Services on Windows



Batch file to restart IIS
@echo off
REM - File: iisrestart.bat
REM - Description: Restart's IIS (Web, FTP, SMTP)
REM - Author: Pete Freitag
REM - ADD REM comments if you don't want to restart any
REM - of Services
echo Restarting IIS...
echo ======================================================
net stop "World Wide Web Publishing Service"
net start "World Wide Web Publishing Service"
net stop "FTP Publishing Service"
net start "FTP Publishing Service"
net stop "Simple Mail Transport Protocol (SMTP)"
net start "Simple Mail Transport Protocol (SMTP)"
echo ======================================================
echo IIS Restarted

Bat files are handy because you can restart multiple services with one command. You can either double click the bat file to run it, schedule it, or throw it in c:\windows\system32 and then run it from anywhere in the command prompt or (Start->Run)