How to Configure SQL Server Agent to Auto-Start After Windows Server Reboot


10 views

Many DBAs and developers encounter situations where SQL Server Agent fails to automatically restart after server reboots. This creates operational headaches since scheduled jobs won't execute until someone manually starts the service. The root cause typically lies in the service's startup configuration rather than any SQL Server-specific setting.

The most reliable method is through Windows Services management console:


# PowerShell method (run as administrator)
Set-Service SQLSERVERAGENT -StartupType Automatic

Or via GUI:

  1. Press Win+R and type services.msc
  2. Locate "SQL Server Agent (MSSQLSERVER)" or your named instance
  3. Right-click → Properties → Set Startup type to "Automatic"

For SQL Server-specific control:


1. Open SQL Server Configuration Manager
2. Navigate to SQL Server Services
3. Right-click SQL Server Agent → Properties
4. Under Service tab, set Start Mode to "Automatic"
5. Restart the service to apply changes

After configuration, test by rebooting or using:


# Check current startup type
Get-Service SQLSERVERAGENT | Select Name, StartType

# Force immediate restart
Restart-Service SQLSERVERAGENT -Force

If issues persist, check:

  • Service account permissions
  • Event Viewer logs for errors
  • Dependencies (SQL Server must start first)

For complex environments, you might need to adjust service dependencies:


# View current dependencies
Get-Service SQLSERVERAGENT -RequiredServices

# Example: Set delayed auto-start (Windows Server 2012+)
sc.exe config SQLSERVERAGENT start= delayed-auto

As a SQL Server database administrator, I've frequently encountered situations where scheduled jobs fail to run after a server restart. The root cause? The SQL Server Agent service doesn't automatically restart with the operating system. This creates significant operational challenges, especially for:

  • Critical overnight batch processes
  • Database maintenance plans
  • Scheduled backups
  • ETL operations

There are multiple approaches to ensure SQL Server Agent starts automatically:

Method 1: Using SQL Server Configuration Manager

1. Open SQL Server Configuration Manager
2. Navigate to "SQL Server Services" 
3. Right-click "SQL Server Agent (INSTANCE_NAME)"
4. Select "Properties"
5. In the "Service" tab, set "Start Mode" to "Automatic"
6. Click "OK" to save changes

Method 2: Via Windows Services Console

1. Press Win+R, type "services.msc" and hit Enter
2. Locate "SQL Server Agent (INSTANCE_NAME)"
3. Right-click and select "Properties"
4. Set "Startup type" to "Automatic"
5. Click "Apply" then "OK"

Method 3: PowerShell Automation

For those managing multiple instances, PowerShell provides a scalable solution:

# Set SQL Server Agent to auto-start for default instance
Set-Service -Name "SQLSERVERAGENT" -StartupType Automatic

# For named instances (replace INSTANCE_NAME)
Set-Service -Name "SQLAgent$INSTANCE_NAME" -StartupType Automatic

# Verify the change
Get-Service "SQLSERVERAGENT" | Select-Object Name, StartType

If the service still doesn't auto-start:

  • Verify service dependencies are met (SQL Server must start first)
  • Check the SQL Server error log for startup failures
  • Confirm adequate permissions for the service account
  • Review Windows Event Viewer for system-level errors

For systems where SQL Server needs more time to initialize:

# Set delayed auto-start via registry
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT" -Name "DelayedAutostart" -Value 1