Andrew Jones
Andrew Jones

Reputation: 293

Which permissions does the local service account have, by default, when accessing an un-configured database in SQL Express 2008?

I have an SQL Express 2008 R2 instance running under the "Local System" account. I have written a windows service that also runs under the "Local System" account. The windows service uses the following connection string to connect to the sql server.

Data Source=.\sqlexpress;Initial Catalog=mydatabase;Integrated Security=True

When the application is installed I create the database with a simple SQL script which does not set any permissions or roles...it just creates the database and tables.

How does my windows service running as "Local System" manage to access the database? What rights is it getting in the SQL database? How is it getting these rights?

Andrew

Upvotes: 4

Views: 5592

Answers (2)

Zorayr
Zorayr

Reputation: 24902

Some of the rights granted to the Local System account are determined by the roles it has been assigned to.

If you login through Microsoft SQL Server Management Studio, expand Security folder, right click on NT AUTHORITY\SYSTEM, and select Properties, you should be able to see the roles assigned to the Local System user in the Server Roles section.

enter image description here

You can read more about each role at, Server-Level Roles document by Microsoft.

Hope this helps!

Upvotes: 1

RichardTheKiwi
RichardTheKiwi

Reputation: 107696

If you expand the tree on the left (Object Explorer) in SSMS to Security, then Logins, you will see "NT AUTHORITY\SYSTEM". By default provisioning after installing SQL Server 2008 R2 Express, this account is added to the sysadmin role.

FYI - Your service running as Local System + Integrated Security means it is authenticating with SQL Server as the Windows account NT AUTHORITY\SYSTEM.

http://msdn.microsoft.com/en-us/library/ms188659.aspx

sysadmin Members of the sysadmin fixed server role can perform any activity in the server.

Upvotes: 3

Related Questions