Application Pool Identity seemingly running as network service - asp.net

I've run into an issue managing our dev IIS instance and an MVC 3 web application. The issue is that when I try to connect to the database from the IIS machine via one of our website I get the error: Login failed for user . Where is the name and domain of the server IIS is running on. The IIS server and SQL Server are on two different machines. I have read multiple questions on SO and other sites and it said to run under application pool identity, which we are doing. We have a user for the database that is tied to the application pool identity.
The site was operating as expected yesterday but after a server reboot it seems to have caused this issue. I have checked everywhere and there is not an area that would cause this to run under NETWORK SERVICE or LOCAL SERVICE. I've been banging my head on this problem all day and was hoping that there was some solution that I have missed.

Related

SignalR Performance counter not displaying in the performance monitor

I installed the Microsoft.AspNet.SignalR.Utils version 1.1.0.0 and then install the performance counters using signalr.exe ipc.
In the performance monitor under category "signalr" I can see all the performance counters but it says no instances...so if I add one of the counters in the monitor they don't appear.
My signalr server is hosted on IIS as asp.net web api. Both server and client are using same version of signalr i.e. 1.1.0.0.
Any idea?
I was having the same issue while trying to run the "Microsoft.AspNet.SignalR.LoadTestHarness" from the SignalR source code. I even went so far as to create a full website in my local IIS 8 on Windows 8 (with a DNS entry in my machine's host file pointing the website address to my loop-back ip address - 127.0.0.1).
What ended up working for me was changing the AppPool's Identity to LocalSystem where the load test harness site was running.
A quick how-to for those not familiar, open up IIS, go to the Application Pools, find the Application Pool that the site in question is running under, right-click>Advanced Settings, find the Identity entry, and change it to LocalSystem (from ApplicationPoolIdentity).
Hope this helps.
To use these on full IIS you need to add the app pool user for your application to the Performance Monitor Users group.

System.UnauthorizedAccessException while accessing network shared file through IIS7.5 application on windows server 2008

I found similar looking issues, however none of the solution i found have worked for me. I do not have much knowledge about IIS or network security so posting my issue here. If anyone has any comments, i would really appreciate.
I am running my webApplication under IIS7.5 on windows server 2008.
-Web Server Machine is not domain controlled.
-Through web application, I am trying to access a network Shared location (machine1 which is also not domain controlled).
I keep on getting this error "System.UnauthorizedAccessException: Access to the path "\\Machine1\Shared\Test.txt" is denied." I am using UNC Path.
I shared the network shared directory with Full permissions to various users including, "everyone", "Network service", "IUSR", "IIS_IUSRS". Just to see it working firstly.
web application is running under IIS in their own application pool with "Managed pipeline mode" as classic and "Identity" as "Network Service".
Note: even tried changing mode to "integrated". It did not work.
I want to run IIS under Network Service. Running IIS under any other user account matching with an user account on network shared is not a solution for me either.
Even though i tried it, could not make it working.
I used process monitor on the network computer which has shared directory and i was expecting network service to access the file, however i do not see any process trying to access the file or create it. I am not sure either Which process is expected to access this file and under which account?
Looking for help.

View state errors in development but not production

I have two websites which are more or less identical, both running on the same server, but under different app pools. The app pools are both configured to run with "NETWORK SERVICE" credentials.
On one website - call this the development copy, I receive the infamous "validation of view state MAC failed" error. This happens when a postback occurs after the page is idle for 20 minutes. I've been informed this is because I don't specify the machine key in the web.config or the machine config file. Manually recycling the app pool reproduces the error as expected. So my question is not about how to stop the issue, but rather I want to know why the error happens in dev but not production. The only difference between the setup of the two sites is the authentication method.
In the "basic settings" section of the IIS config, the dev version of the site is set to connect using a service account, while the production version is using "application user" (pass through authentication). Under authentication settings, both pages are configured with impersonation and windows authentication.
This is the only difference I can see. My knowledge of how IIS handles authentication at the site and app pool level is fairly limited. Is there a specific reason why one setup should result in the machine key being refreshed but the other does not?
After installing .NET 3.5 SP1 you may get Validation of viewstate MAC failed exceptions when doing post backs on ASP.NET pages.

IIS 6.1 Server 2003 Web Apps Don't Startup on Reboot Sometimes

Occasionally when I reboot one of the servers at a client site the Web Apps running in IIS do not automatically start backup when the server is done rebooting. The IIS service starts up just fine, its set to Auto Start and there are no errors in the event log. Just none of the Web Apps are running, I have to click each one and click start. This only happens occasionally, as they usually start but its completely baffling.
Any thoughts? Its a mix of Classic ASP and ASP.NET applications. There are a total of 4 application pools running between around 8 web applications.
I have seen this happen when apps rely on a resource that is not yet available to the server, such as a network share.
Some people combat this problem by writing a Windows Service who's job is to check for such conditions and start the application.

Application Pools not starting after iisreset

Before I start, I know using iisreset is considered bad practice, but this shouldn't happen anyway..
What we have:
Several machines with IIS6 on Windows Server 2003 R2 (both 64 and 32 bits)
Several WCF webservices (.NET runtime 2.0) deployed in several applications, each with it's own application pool, each application pool running under an other windows account.
What happens:
All appPools are started, all services operational
IISReset is executed (or the machine is rebooted)
IIS comes back up, but not all application pools start properly. Sometimes they all come back up, sometimes one or more pools won't start. They can be started manually however.
Is this "normal" iis behavior and should I just avoid using iisreset, or are we doing something wrong in our .NET code?
The application pools should restart on an iisreset, but they do run outside of iis (in COM+) for reliability. This mean they may may not come back if the application is misbehaving, but IIS and the other apps will(should) come back. So yes, This is "normal".
P.S.
I would also like to "OUT" myself as a proud user of iisreset. Bad practice? Bah! ;D
IIS does not immediately start ASP.NET worker processes (w3wp.exe) until the first request comes in. When you say "not started", does it mean you attempt to access some WCF web services (after iisreset), and you get a Service Unavailable error because the appPool cannot be started? Do you see any IIS W3SVC related entries in the Event logs?
If there are, they may be able to clue you in why they cannot start; post them up here.
Reason:
IIS does not immediately start ASP.NET worker processes (w3wp.exe) until the first request comes in. When it says "not started" it mean you attempt to access some WCF web services (after iisreset) failed due to object was holding some space in memory, and you get a Service Unavailable error because the appPool cannot be started.
Workaround:
Create Batch file with following commands & schedule it.
net stop 23svc
net stop msftpsvc
net stop smtpsvc
net stop PleskControlPanel
net stop HTTPFilter
iisreset /restart
net start w3svc
net start msftpsvc
net start smtpsvc
net start PleskControlPanel
net Start HTTPFilter
Had similiar issue - after IIS has been restarted, DefaultAppPool was stopped.
In application event logs found an error:
Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, or that your network is functioning correctly. If this problem persists, contact your network administrator.
DETAIL - Access is denied.
Fixed by setting in DefaultAppPool Advanced Settings option Load User Profile to False.
Hope it could be usefull.
In a prior support role, I managed several IIS servers running all kinds of .NET mess. When an AppPool failed to start, it was usually a bad login credential.
Re-setting the identity (auth credentials) via advanced settings of the Application pool worked for me.
Earlier I changed my active directory password and as the app pool was already running, it worked fine until I performed IISRESET.

Resources