开发者

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 Secu开发者_开发技巧rity=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


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.


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.

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

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

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜