Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have removed by accident SQLServerAgent account and now I can't get access to the database.

Connecting from SSMS throws me an error, and system log shows:

Error 26 SQLServerAgent could not be started (reason: Error creating a new session). .

How can I restore or recreate the SQL Server Agent account?

share|improve this question

migrated from stackoverflow.com Sep 3 '11 at 22:12

This question came from our site for professional and enthusiast programmers.

    
jackal, this is the type of questions you should ask on serverfault rather than stackoverflow. People are more proficient there for system management (in theory, here are frightening guys too ;) ) and it's not programming related. –  Kheldar Sep 3 '11 at 18:31
    
thx for suggestion. I wasnt familiar with serverfault –  jackal Sep 3 '11 at 18:45
    
possible duplicate of Removed SQLServerAgent account What should I do? –  Wesley Sep 4 '11 at 1:29

2 Answers 2

The Agent is a separate process from the SQL Server database engine. You should be able to run the SQL Server Agent under another account with the minimum privileges necessary.

share|improve this answer

This is my answer on a similar question, however on the chance that this question is not closed as an exact duplicate and for the benefit of future readers, I'll reproduce it here:

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.