Sunday, December 12, 2010

login failed for user nt authority\network service

Error
=================
login failed for user nt authority\network service

Solution
==========
To manually set the permission for NT AUTHORITY\NETWORK SERVICE, follow these steps:1.
Click Start, click Run,

type %systemroot%\Help\iisHelp, and then click OK.

2. Right-click the Common folder, and then click Sharing and Security.
3. On the Security tab, click Add, type NETWORK SERVICE, and then click OK.
4. Click NETWORK SERVICE, click to select the following check boxes under Allow, and then click OK: • Read and Execute
• List Folder Contents
• Read
5. Click Start, click Run,

type %systemroot%\system32\inetsrv, and then click OK.

6. Right-click the ASP Compiled Templates folder, and then click Sharing and Security.
7. On the Security tab, click Add, type NETWORK SERVICE, and then click OK.
8. Click NETWORK SERVICE, click to select the Full Control check box under Allow, and then click OK

9. Click Start, click Run,

type %systemroot%, and then click OK.

10. Right-click the IIS Temporary Compressed folder, and then click Sharing and Security.
11. On the Security tab, click Add, type NETWORK SERVICE, and then click OK.
12. Click NETWORK SERVICE, click to select the Full Control check box under Allow, and then click OK

After you have completed these steps, restart the IIS Admin Service. To do this, follow these steps:
1. Click Start, click Run,

type Services.msc, and then click OK.

2. Right-click IIS Admin, and then click Restart.


exec sp_grantlogin N'NT AUTHORITY\NETWORK SERVICE'
EXEC sp_grantdbaccess N'NT AUTHORITY\NETWORK SERVICE'

Friday, October 8, 2010

STS OES - Importing Data file manually

1) copy import file (zip) to H:\NEWSYS\UPDATE\01_in

2) delete LASTFILE.MEM on that folder...

3) open OES and do the normal import process and type file name manually

4) after import is done.. again delete LASTFILE.MEM

Tuesday, June 15, 2010

unable to start debugging on the web server. the server committed a protocol violation

The server committed a protocol violation

Skype nearly got me into screaming this night. I was debugging an ASP.NET 2.0 problem and at some time the IIS started to behave very strange. The debugging in Visual Studio failed with error “Unable to start debugging on the web server. The server committed a protocol violation. Section=ResponseStatusLine” and any attempt to load a page from the local IIS server returned an empty page even for those that did not exist :). At some time (couple of hours lost) I saw in the IIS Management Console that the web site was not running at all. When I tried to start it I got the error “Unexpected Error 0x8ffe2740 Occurred” and the long awaited event log entry (there was no entry at the time I tried to start the web site) – Event ID: 115 Description: “The service could not bind instance 1.”. A quick google showed that this error is due to already opened port 80 and the web server just could not open and use that port. Indeed netstat –a showed that port 80 is already opened but there was no way to see who was using it. This is where TCPView, marvelous tool from Sysinternals, helped a lot (Update: I just found that netstat –b would display the owning processes of each connection.). There was Skype listening on port 80, obviously taken ownership of the socket during the number of restarts when I was debugging. How stupid is that?
Attention to all web developers who are using Skype! Make sure to uncheck the option for using port 80 and 443 from Tools\Options\Connection dialog.

Sunday, May 23, 2010

Clear all connections to a MSSQL database

Clear all connections to a MSSQL database

USE master; GO ALTER DATABASE dbName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO ALTER DATABASE dbName SET MULTI_USER; GO

Rapair MS Sql Table for Error (DBCC)

Error : A possible dabase consistency problem has been detected on databse [dbname]. DBCC CheckdB or DBCC CheckCatalog should be run on database [dbname].

Solution :

check which table creates the problem and run the below comamnds.

1) ALTER DATABASE [dbname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

2) DBCC Checktable('tablename',repair_allow_data_loss)

3) ALTER DATABASE [dbname] SET MULTI_USER;