IIS 7 "account that is running application pool" - iis-7

I need to find out which account is running one of my websites application pool.
I need to add the user to a database in SQL Server.
Using IIS Manager, is there a way to check?

The "Identity" column in the Application Pool area of IIS is the account.

If you're running asp.net a quick and dirty way is a helper aspx page like so:
<%#Page %>
IIS is running as :
<%=System.Security.:Principal.WindowsIdentity.GetCurrent().Name%>

Related

Difference between VS2012 Development ASP.NET Page and IIS Deployed Page Getting Username

So i am attempting to get the username of the person currently logged into the system.
While developing in VS2012 and running the debugger having it run its VS Development Server, i can use Environment.Username to get this.
But when i deploy to an IIS server I get the username ASP.NET v4.0, which i am pretty sure is because im using the ApplicationPoolIdentity in IIS for my Site(using IIS 7.5)
My goal is for the website to be accessible to anyone on the domain without requiring a login or anything, but still be able to grab their username so that i can give certain users access to administrative features and create SQL queries to build tables based on their login.
These user names and groups are stored in a database separate from the website, not part of ASP.NET forms logins or anything.
Environment.Username will give you the application pool identity. Since it is 'you' who is running VS, it will give your name on the development machine.
You should implement windows authentication and use HttpContext.Current.User to access the current user.

401.2 Error in ASP.Net 2.0 on IIS 7.0 on Windows 2008

My "Hello World" c#.Net application works fine on my local Windows 7. Moving to our server I get 401.2 error.
Here what I have done (following advices in some forums):
Changed the Anonymous authentication use to application pull user
Created a new application pull
Created a new Windows user with access to application folders
Set the authentication of the application pull to that user
Set the application pull for my application to that application pull
Please note that:
I receive the error both from within the server and outside
I receive this error from all the browser I tested: Chrome, IE 9.0 and Firefox
An html file in the same folder is visible
What am I missing?
Thanks,
Asaf
You don't need to create a new windows user. I know you've said what steps you've done, but I'm going to highlight what I do each time I add a new site.
Set the Identity of the Application Pool to
ApplicationPoolIdentity.
In the website, set Anonymous Authentication to Enabled. Click
Edit on the right and set the Authentication Credentials to
Application pool identity.
In the website, again, choose Basic Settings on the right. Click
the Connect As.. button and make sure Application User is
selected.
Give the appropriate access to the folder on your hard drive(s); i.e
Application Pool name = hello.com, the user is IIS
AppPool\hello.com.
I think your issue is that you haven't given the folder permissions for the Application Pool User. I think you've incorrectly given them to an unneccessary Windows account.
HTH
Do you have the correct version of .NET installed on Server? Also you need to register ASP.NET in IIS - c:\windows\Microsoft.NET\framework\v2.0.50727 (or v4.0....)
aspnet_regiis.exe -i
and after restart IIS with iisreset in command line

403 - Forbidden on basic MVC 3 deploy on iis

I have an ASP.NET MVC 3 application, which runs on a IIS 7.5. Everything works great if i access the application locally from the Windows Server, but if i try to access it from a remote client the browser throws an error.
The HTML loads fine when i try to access the site remotely, but when it make AJAX calls it fails with this msg:
POST 403 (Forbidden: header 'Content-Type' value denied)
I have tried:
- using jQuery jsonp
- Granting webfolder accees to "Everyone" in Folder security and sharing
Do you have any other suggentions for a solution?
Check if the file global.asax exists.
I had get the same problem because I forgot to upload this file.
Does your web server have ASP.NET 4 installed? You may need to run this command:
%windir%\Microsoft.NET\Framework64\v4.0.30128\aspnet_regiis.exe -ir
Edit: OK, so this wasn't the problem... Security is the next thing to check: This article might help you... http://learn.iis.net/page.aspx/624/application-pool-identities/
Generally when I've seen stuff like this, IIS is running your site under it's limited user instead of the application pool user.
To check this configuration you need to access IIS Manager, expand the computer name, expand sites, expand the web site that contains your application, select your application in the tree view.
Under the IIS settings region, select Authentication (double click it, or click open feature)
Select Anonymous Authentication, click edit... from actions on the right. In the dialog that opens check the setting for Anonymous user identity: it should be set to application pool identity.
Original Answer by Mmerrell at Getting 404.0 error for ASP.NET MVC 3 app on IIS 7.0 / Windows Server 2008
You actually just reminded me that I needed to fix this issue in an
enviroment here. If your situation is the same as mine then it's a
simple fix.
Just add the following to your web config:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />

URLRewriting.net and IIS 7 Problem

net 2.0/umbraco 4.0.3 website hosted in IIS6 with a couple of url rewrites using http://urlrewriting.net/ ..
We just moved the site to IIS 7/classic pool and the URL rewrites stopped working.. can anyone give a hint of what might be the issue as we are trying for sometime without any luck!
Regards,
Anz
#mahesh Umbraco 4.0.3 only requires .NET 3.5 (read: .NET 2.0 with AJAX libraries, which are included in the distribution).
#Anz, best things to check for are:
Have you added the wildcard ISAPI handler to the site for Classic mode? For extensionless URLs to work, you must add a wildcard handler to the site, which then points to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll. This applies to IIS6 and IIS7 sites in Classic mode (IIS6 only has classic mode).
In Integrated mode, however, this isn't required... so you could try switching your application pool to Integrated mode and see if this works.
Check your application pool's identity. Sometimes the site won't load components properly because the identity of the application pool can't access them. In IIS7, you have a new principle called ApplicationPoolIdentity, which creates a new user just for that app-pool, in the format "IIS APPPOOL\". If your app-pool has it's Identity property set to ApplicationPoolIdentity, you need to grant read/write/modify access on it by going to the folder, right-clicking and hitting Properties, switching to Security, click "Edit", click "Add...", type "IIS APPPOOL\" (without quotes, with all spaces), click OK. Set the "Modify" attribute against this user, click Apply, click Close.
HTH,
Benjamin
Alternatively:
I had upgraded the server from 32-bit Windows to 64-bit Windows.
Needed to check 'allow 32-bit applications' on the app pools.

IIS7 folder permissions for web application

I am using windows authentication without impersonation on my company's intranet website with IIS7.
Under IIS7, what account is used to access the folder which contains my web app using these settings?
Would it be IIS_IUSRS? Or NETWORK SERVICE? Or another I don't know about?
In IIS 7 (not IIS 7.5), sites access files and folders based on the account set on the application pool for the site. By default, in IIS7, this account is NETWORK SERVICE.
Specify an Identity for an Application Pool (IIS 7)
In IIS 7.5 (Windows 2008 R2 and Windows 7), the application pools run under the ApplicationPoolIdentity which is created when the application pool starts. If you want to set ACLS for this account, you need to choose IIS AppPool\<yourpoolname> instead of NT Authority\Network Service.
http://forums.iis.net/t/1187650.aspx has the answer. Setting the iis authentication to appliction pool identity will resolve this.
In IIS Authentication, Anonymous Authentication was set to "Specific User". When I changed it to Application Pool, I can access the site.
To set, click on your website in IIS and double-click "Authentication". Right-click on "Anonymous Authentication" and click "Edit..." option. Switch from "Specific User" to "Application pool identity". Now you should be able to set file and folder permissions using the IIS AppPool\{Your App Pool Name}.
If it's any help to anyone, give permission to "IIS_IUSRS" group.
Note that if you can't find "IIS_IUSRS", try prepending it with your server's name, like "MySexyServer\IIS_IUSRS".
Running IIS 7.5, I had luck adding permissions for the local computer user IUSR. The app pool user didn't work.
Worked for me in 30 seconds, short and sweet:
In IIS Manager (run inetmgr)
Go to ApplicationPool -> Advanced Settings
Set ApplicationPoolIdentity to NetworkService
Go to the file, right click properties, go to security, click edit, click add, enter Network Service (with space, then click 'check names'), and give full control (or just whatever permissions you need)
Working on IIS 7.5 and Windows 7 i couldnt give permission
APPPOOL/Mypool
IUSR and IIS_IUSRS permissions not working for me
I got to problem this way:
-Created console application with C#
-This appliaction using createeventsource like this
if(!System.Diagnostics.EventLog.SourceExists(sourceName)) System.Diagnostics.EventLog.CreateEventSource(sourceName,logName);
-Build solution and get .exe file
-Run exe as administator.This create log file.
NOTE: Dont remember Event viewer must be refresh for see the log.
I hope this solution helps someone :)
Read/Write permission for Web host application using IIS follow following step:-
1)Check the Application pool for the Site
2)Go to Application Pool and Check the Identity of the Site.
3)Explorer the Site and go to the main folder and right-click on that folder.
4)Go to Security Tab and click on the Edit button and then click on the user Identity and below you can see the multiple check box options which you want to provide permission for authenticated users after selecting the check box click on save.

Resources