Removed SQLServerAgent account What should I do ?

I have removed by accident SQLServerAgent account and now I cant get access to the database. Connecting from management studio throws me error 26 and system log shows: SQLServerAgent could not be started (reason: Error creating a new session). . I have googled out that's cause of it may be lack of account but ... how to restore it!?


Create a new local or domain account (depending on your environment and its needs) and manually assign it the proper permissions. The MSDN article I linked to is for SQL Server 2008 R2, and you didn't mention your specific version of SQL Server. However, it makes no difference. The principle remains the same. Simply create a new account and assign it the proper permissions for your version of SQL Server. The required permissions for each service account are easily found by searching for them in the product documentation (SQL Server Books Online).

You might also want to look at the article titled "Setting Up Windows Service Accounts" on MSDN for a refresher in the general concept of service accounts and permission. Once again the article is specific to SQL Server 2008 R2, but the principles remain the same. Search for documentation for your specific product version.