locked
how to grant 'Network Service' or 'ASPNET' user accounts permissions to connect to database RRS feed

  • Question

  • User1537614592 posted

    set up asp .net user account on sql server 2005

    Question: I've read the instructions in this article: http://www.netomatix.com/Development/aspnetuserpermissions.aspx


    But do not know how to do this:
    You can grant 'Network Service' or 'ASPNET' user accounts permissions to connect to database.

    Please provide example on how to do this, thanks!
    Monday, February 18, 2008 7:26 PM

Answers

  • User1790760290 posted

    It is the Config for SQL SERVER 2005,

     

    Use your SQL Server Management Studio, under Security, Logins, New Login add NetWork Service and give grant to which database permetion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 18, 2008 8:57 PM
  • User-1383698360 posted

    You should grant access to network service account if you have the worker process running under NetworkServices and ASPNET if you are running a IIS 5.0 web site with out modification.

    anycase this are the steps:

    Open enterprise manager or management studio and right click on logins under secruty node to create a new user , and supply YOURCOMPUTERNAME\NETWORK SERVICE and grant dbo or db_writer access to the database.

    If not you can use the following T-SQL (not tested) to grant access.

    Use the following queries after loging to Enterprise Manager or Management studio

    USE AdventureWorks
    GO
    CREATE LOGIN [YOURCOMPUTERNAME\NETWORK SERVICE] FROM WINDOWS;
    GO CREATE USER [NETWORK SERVICE] FOR LOGIN [YOURCOMPUTERNAME\NETWORK SERVICE]
        WITH DEFAULT_SCHEMA = YourDatabase;
    GO
    EXEC sp_addrolemember 'dbo', 'NETWORK SERVICE'
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 18, 2008 9:10 PM

All replies

  • User1790760290 posted

    It is the Config for SQL SERVER 2005,

     

    Use your SQL Server Management Studio, under Security, Logins, New Login add NetWork Service and give grant to which database permetion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 18, 2008 8:57 PM
  • User-1383698360 posted

    You should grant access to network service account if you have the worker process running under NetworkServices and ASPNET if you are running a IIS 5.0 web site with out modification.

    anycase this are the steps:

    Open enterprise manager or management studio and right click on logins under secruty node to create a new user , and supply YOURCOMPUTERNAME\NETWORK SERVICE and grant dbo or db_writer access to the database.

    If not you can use the following T-SQL (not tested) to grant access.

    Use the following queries after loging to Enterprise Manager or Management studio

    USE AdventureWorks
    GO
    CREATE LOGIN [YOURCOMPUTERNAME\NETWORK SERVICE] FROM WINDOWS;
    GO CREATE USER [NETWORK SERVICE] FOR LOGIN [YOURCOMPUTERNAME\NETWORK SERVICE]
        WITH DEFAULT_SCHEMA = YourDatabase;
    GO
    EXEC sp_addrolemember 'dbo', 'NETWORK SERVICE'
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 18, 2008 9:10 PM