By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

How to change the account that ASP.NET uses

P: n/a
Hi,

How to change the account that ASP.NET uses for this
virtual directory to one that has rights to the SQL Server
box.

Or how to use impersonation set in the Web.config file for
the asp application, referring to an account that has
rights to the SQL Server box.

Pls step by step ;)

Regards.
Nov 18 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
http://support.microsoft.com/?id=317012#5b

<identity impersonate="true" username="domain\username"
password="password" />

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in message
news:27*****************************@phx.gbl...
Hi,

How to change the account that ASP.NET uses for this
virtual directory to one that has rights to the SQL Server
box.

Or how to use impersonation set in the Web.config file for
the asp application, referring to an account that has
rights to the SQL Server box.

Pls step by step ;)

Regards.

Nov 18 '05 #2

P: n/a
i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please
review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spécifiée '
Regards.

-----Original Message-----
http://support.microsoft.com/?id=317012#5b

<identity impersonate="true" username="domain\username"
password="password" />

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in messagenews:27*****************************@phx.gbl...
Hi,

How to change the account that ASP.NET uses for this
virtual directory to one that has rights to the SQL Server
box.

Or how to use impersonation set in the Web.config file for
the asp application, referring to an account that has
rights to the SQL Server box.

Pls step by step ;)

Regards.

.

Nov 18 '05 #3

P: n/a
You might not have appropriate permissions to run the Application.

Check the below link to create Custom Account to run ASP .Net and specify this account in Machine.config or specify it at Application Pool Identity.

http://msdn.microsoft.com/library/de...SecNetHT01.asp

Regards
Somu
"an*******@discussions.microsoft.com" wrote:
i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please
review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spƩcifiƩe '
Regards.

-----Original Message-----
http://support.microsoft.com/?id=317012#5b

<identity impersonate="true" username="domain\username"
password="password" />

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in

message
news:27*****************************@phx.gbl...
Hi,

How to change the account that ASP.NET uses for this
virtual directory to one that has rights to the SQL Server
box.

Or how to use impersonation set in the Web.config file for
the asp application, referring to an account that has
rights to the SQL Server box.

Pls step by step ;)

Regards.

.

Nov 18 '05 #4

P: n/a
You might not have appropriate permissions to run the Application.

Check the below link to create Custom Account to run ASP .Net and specify this account in Machine.config or specify it at Application Pool Identity.

http://msdn.microsoft.com/library/de...SecNetHT01.asp

Regards
Somu
"an*******@discussions.microsoft.com" wrote:
i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please
review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spƩcifiƩe '
Regards.

-----Original Message-----
http://support.microsoft.com/?id=317012#5b

<identity impersonate="true" username="domain\username"
password="password" />

--
Hope this helps,
Zeeshan Mustafa, MCSD
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in

message
news:27*****************************@phx.gbl...
Hi,

How to change the account that ASP.NET uses for this
virtual directory to one that has rights to the SQL Server
box.

Or how to use impersonation set in the Web.config file for
the asp application, referring to an account that has
rights to the SQL Server box.

Pls step by step ;)

Regards.

.

Nov 18 '05 #5

P: n/a
Might i have just to give the rights to ASPNET user account
in SQL Server, no?

But how could i make it ? (sql server 2005 express)

Resgards.
-----Original Message-----
You might not have appropriate permissions to run the Application.
Check the below link to create Custom Account to run ASP ..Net and specify this account in Machine.config or specify
it at Application Pool Identity.
http://msdn.microsoft.com/library/de...SecNetHT01.asp

Regards
Somu
"an*******@discussions.microsoft.com" wrote:
i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please
review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spƩcifiƩe '


Regards.

>-----Original Message-----
>http://support.microsoft.com/?id=317012#5b
>
><identity impersonate="true" username="domain\username"
> password="password" />
>
>--
>Hope this helps,
>Zeeshan Mustafa, MCSD
>
>
>"Mr.KisS" <an*******@discussions.microsoft.com> wrote in

message
>news:27*****************************@phx.gbl...
>> Hi,
>>
>> How to change the account that ASP.NET uses for this
>> virtual directory to one that has rights to the SQL Server >> box.
>>
>> Or how to use impersonation set in the Web.config file for >> the asp application, referring to an account that has
>> rights to the SQL Server box.
>>
>> Pls step by step ;)
>>
>> Regards.
>
>
>.
>


.

Nov 18 '05 #6

P: n/a
have a look at:
http://support.microsoft.com/?id=307626

solution here:
http://msdn.microsoft.com/webservice...SecNetHT01.asp
--
Hope this helps,
Zeeshan Mustafa, MCSD
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in message
news:27*****************************@phx.gbl...
Might i have just to give the rights to ASPNET user account
in SQL Server, no?

But how could i make it ? (sql server 2005 express)

Resgards.
-----Original Message-----
You might not have appropriate permissions to run the Application.
Check the below link to create Custom Account to run ASP ..Net and specify this account in Machine.config or specify
it at Application Pool Identity.
http://msdn.microsoft.com/library/de...-us/dnnetsec/h tml/SecNetHT01.asp
Regards
Somu
"an*******@discussions.microsoft.com" wrote:
i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.
----------------------------------------------------------------------------
----
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please
review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spƩcifiƩe '
Regards.

>-----Original Message-----
>http://support.microsoft.com/?id=317012#5b
>
><identity impersonate="true" username="domain\username"
> password="password" />
>
>--
>Hope this helps,
>Zeeshan Mustafa, MCSD
>
>
>"Mr.KisS" <an*******@discussions.microsoft.com> wrote in

message
>news:27*****************************@phx.gbl...
>> Hi,
>>
>> How to change the account that ASP.NET uses for this
>> virtual directory to one that has rights to the SQL Server >> box.
>>
>> Or how to use impersonation set in the Web.config file for >> the asp application, referring to an account that has
>> rights to the SQL Server box.
>>
>> Pls step by step ;)
>>
>> Regards.
>
>
>.
>

.


Nov 18 '05 #7

P: n/a
There are three stored procedures you'll need to execute. You can
connect with Visual Studio, or from the command line with SQLCMD.

Feel free to msg if you need help with the above. Once you are
connected you'll need to exec sp_grantlogin 'machinename\ASPNET, which
allows ASPNET to login.

Use exec sp_grantdbaccess 'machinename\ASPNET' to give the ASPNET
account access to a database, and exec sp_addrolemember
'rolename','machinename\ASPNET' to add the login to a role, like
'public', or 'db_datareader'.

HTH,

--
Scott
http://www.OdeToCode.com
On Tue, 6 Jul 2004 08:59:15 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
Might i have just to give the rights to ASPNET user account
in SQL Server, no?

But how could i make it ? (sql server 2005 express)

Resgards.
-----Original Message-----
You might not have appropriate permissions to run the

Application.

Check the below link to create Custom Account to run ASP

.Net and specify this account in Machine.config or specify
it at Application Pool Identity.

http://msdn.microsoft.com/library/de...SecNetHT01.asp

Regards
Somu
"an*******@discussions.microsoft.com" wrote:
i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please
review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spƩcifiƩe '
Regards.
>-----Original Message-----
>http://support.microsoft.com/?id=317012#5b
>
><identity impersonate="true" username="domain\username"
> password="password" />
>
>--
>Hope this helps,
>Zeeshan Mustafa, MCSD
>
>
>"Mr.KisS" <an*******@discussions.microsoft.com> wrote in
message
>news:27*****************************@phx.gbl...
>> Hi,
>>
>> How to change the account that ASP.NET uses for this
>> virtual directory to one that has rights to the SQLServer >> box.
>>
>> Or how to use impersonation set in the Web.configfile for >> the asp application, referring to an account that has
>> rights to the SQL Server box.
>>
>> Pls step by step ;)
>>
>> Regards.
>
>
>.
>

.


Nov 18 '05 #8

P: n/a
Ok, and for :

grantdbaccess , what fixed database role must i give for
asp.net? it's for normal use : select, update, execeute
stocked procedures, insett, alter, etc...

Which one?

db_owner
db_accessadmin
db_securityadmin
db_ddladmin
db_backupoperator
db_datareader
db_datawriter
db_denydatareader
db_denydatawriter

Regards.
-----Original Message-----
There are three stored procedures you'll need to execute. You canconnect with Visual Studio, or from the command line with SQLCMD.
Feel free to msg if you need help with the above. Once you are
connected you'll need to exec sp_grantlogin 'machinename\ASPNET, whichallows ASPNET to login.

Use exec sp_grantdbaccess 'machinename\ASPNET' to give the ASPNETaccount access to a database, and exec sp_addrolemember
'rolename','machinename\ASPNET' to add the login to a role, like'public', or 'db_datareader'.

HTH,

--
Scott
http://www.OdeToCode.com
On Tue, 6 Jul 2004 08:59:15 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
Might i have just to give the rights to ASPNET user account
in SQL Server, no?

But how could i make it ? (sql server 2005 express)

Resgards.
-----Original Message-----
You might not have appropriate permissions to run the

Application.

Check the below link to create Custom Account to run ASP

.Net and specify this account in Machine.config or specify
it at Application Pool Identity.

http://msdn.microsoft.com/library/de...SecNetHT01.asp

Regards
Somu
"an*******@discussions.microsoft.com" wrote:

i've done that (i've no password in my account):
<identity impersonate="true" userName="KLEO\Lazhar"
password="" />
<authentication mode="Windows"/>

But i get this error message :

Server Error in '/myapp' Application.

--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the specific error details below and modify your
configuration file appropriately.

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'Erreur non spƩcifiƩe '


Regards.


>-----Original Message-----
>http://support.microsoft.com/?id=317012#5b
>
><identity impersonate="true" username="domain\username"
> password="password" />
>
>--
>Hope this helps,
>Zeeshan Mustafa, MCSD
>
>
>"Mr.KisS" <an*******@discussions.microsoft.com> wrote in
message
>news:27*****************************@phx.gbl...
>> Hi,
>>
>> How to change the account that ASP.NET uses for this
>> virtual directory to one that has rights to the SQL

Server
>> box.
>>
>> Or how to use impersonation set in the Web.config

file for
>> the asp application, referring to an account that has
>> rights to the SQL Server box.
>>
>> Pls step by step ;)
>>
>> Regards.
>
>
>.
>

.


.

Nov 18 '05 #9

P: n/a
i have gave 'db_creator' role to KLEO\ASPNET but now i get
this error message or, the file wizou.mdf exists :/ Any idea?

Cannot open database 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\wizou.mdf' requested by login.
Login fails. Login failed for user 'KLEO\ASPNET'.

Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.Data.SqlClient.SqlException:
Cannot open database 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\wizou.mdf' requested by login.
Login fails. Login failed for user 'KLEO\ASPNET'.

Any ideas?

Best Regards, thanks for helping me :)
-----Original Message-----
Ok, and for :

grantdbaccess , what fixed database role must i give for
asp.net? it's for normal use : select, update, execeute
stocked procedures, insett, alter, etc...

Which one?

db_owner
db_accessadmin
db_securityadmin
db_ddladmin
db_backupoperator
db_datareader
db_datawriter
db_denydatareader
db_denydatawriter

Regards.
-----Original Message-----
There are three stored procedures you'll need to execute.

You can
connect with Visual Studio, or from the command line with

SQLCMD.

Feel free to msg if you need help with the above. Once you are
connected you'll need to exec sp_grantlogin

'machinename\ASPNET, which
allows ASPNET to login.

Use exec sp_grantdbaccess 'machinename\ASPNET' to give the

ASPNET
account access to a database, and exec sp_addrolemember
'rolename','machinename\ASPNET' to add the login to a

role, like
'public', or 'db_datareader'.

HTH,

--
Scott
http://www.OdeToCode.com
On Tue, 6 Jul 2004 08:59:15 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
Might i have just to give the rights to ASPNET user account
in SQL Server, no?

But how could i make it ? (sql server 2005 express)

Resgards.

-----Original Message-----
You might not have appropriate permissions to run the
Application.

Check the below link to create Custom Account to run ASP
.Net and specify this account in Machine.config or specify
it at Application Pool Identity.

http://msdn.microsoft.com/library/de...SecNetHT01.asp

Regards
Somu
"an*******@discussions.microsoft.com" wrote:

> i've done that (i've no password in my account):
> <identity impersonate="true" userName="KLEO\Lazhar"
> password="" />
> <authentication mode="Windows"/>
>
> But i get this error message :
>
> Server Error in '/myapp' Application.
>
--------------------------------------------------------------------------------
>
> Configuration Error
> Description: An error occurred during the processing of a
> configuration file required to service this request.

Please> review the specific error details below and modify your
> configuration file appropriately.
>
> Parser Error Message: Could not create Windows user token
> from the credentials specified in the config file. Error
> from the operating system 'Erreur non spƩcifiƩe '
>
>
> Regards.
>
>
> >-----Original Message-----
> >http://support.microsoft.com/?id=317012#5b
> >
> ><identity impersonate="true" username="domain\username"
> > password="password" />
> >
> >--
> >Hope this helps,
> >Zeeshan Mustafa, MCSD
> >
> >
> >"Mr.KisS" <an*******@discussions.microsoft.com> wrote in
> message
> >news:27*****************************@phx.gbl...
> >> Hi,
> >>
> >> How to change the account that ASP.NET uses for this
> >> virtual directory to one that has rights to the SQL
Server
> >> box.
> >>
> >> Or how to use impersonation set in the Web.config
file for
> >> the asp application, referring to an account that has
> >> rights to the SQL Server box.
> >>
> >> Pls step by step ;)
> >>
> >> Regards.
> >
> >
> >.
> >
>
.


.

.

Nov 18 '05 #10

P: n/a
It depends a bit on the permissions given to the objects you need to
access, but generally, db_datareader and db_datawriter will do the
trick.

On Tue, 6 Jul 2004 09:30:57 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
Ok, and for :

grantdbaccess , what fixed database role must i give for
asp.net? it's for normal use : select, update, execeute
stocked procedures, insett, alter, etc...

Which one?

db_owner
db_accessadmin
db_securityadmin
db_ddladmin
db_backupoperator
db_datareader
db_datawriter
db_denydatareader
db_denydatawriter

Regards.


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #11

P: n/a
Is the ASPNET login the login that created the database?

On Tue, 6 Jul 2004 09:36:25 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
i have gave 'db_creator' role to KLEO\ASPNET but now i get
this error message or, the file wizou.mdf exists :/ Any idea?

Cannot open database 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\wizou.mdf' requested by login.
Login fails. Login failed for user 'KLEO\ASPNET'.

Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.Data.SqlClient.SqlException:
Cannot open database 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\wizou.mdf' requested by login.
Login fails. Login failed for user 'KLEO\ASPNET'.

Any ideas?


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #12

P: n/a
"Is the ASPNET login the login that created the database?"
=> Sorry, but i dont understand :/
No login has been created?

Which login are you speaking, there is no one? I dont know
the password of ASPNET account, i have never gave one do...

Regards.
-----Original Message-----
Is the ASPNET login the login that created the database?

On Tue, 6 Jul 2004 09:36:25 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
i have gave 'db_creator' role to KLEO\ASPNET but now i get
this error message or, the file wizou.mdf exists :/ Any idea?

Cannot open database 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\wizou.mdf' requested by login.
Login fails. Login failed for user 'KLEO\ASPNET'.

Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.Data.SqlClient.SqlException:
Cannot open database 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\wizou.mdf' requested by login.
Login fails. Login failed for user 'KLEO\ASPNET'.

Any ideas?


--
Scott
http://www.OdeToCode.com
.

Nov 18 '05 #13

P: n/a
Sorry for the confusion, let me back up a step.

You might need to sp_grantdbaccess to ASPNET for the new database and
put it in a database role, like db_reader / db_writer.
On Tue, 6 Jul 2004 11:26:10 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
"Is the ASPNET login the login that created the database?"
=> Sorry, but i dont understand :/
No login has been created?

Which login are you speaking, there is no one? I dont know
the password of ASPNET account, i have never gave one do...

Regards.


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #14

P: n/a
no :/ i've put it :

1> sp_grantdbaccess 'KLEO\ASPNET', 'ASPNET'
2> go
Msg 15151, Level 16, State 1, Server KLEO\SQLEXPRESS, Line 1
Cannot find the user 'ASPNET', because it does not exist or
you do not have perm
ission.
Msg 2759, Level 16, State 1, Server KLEO\SQLEXPRESS, Line 1
CREATE SCHEMA failed due to previous errors.

i'm hopeless, i dont know what i have to do :/
(if u have msn : mi*********@msn.com, better)

Regards.
-----Original Message-----
Sorry for the confusion, let me back up a step.

You might need to sp_grantdbaccess to ASPNET for the new database andput it in a database role, like db_reader / db_writer.
On Tue, 6 Jul 2004 11:26:10 -0700, "Mr.KisS"
<an*******@discussions.microsoft.com> wrote:
"Is the ASPNET login the login that created the database?"
=> Sorry, but i dont understand :/
No login has been created?

Which login are you speaking, there is no one? I dont know
the password of ASPNET account, i have never gave one do...

Regards.


--
Scott
http://www.OdeToCode.com
.

Nov 18 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.