Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS PowerShell Application Pool set as 'NetworkService' Account

I'm trying to create an Application Pool in IIS7 using PowerShell. I want this to run under the NetworkService account but currently this appears to try and set itself as an 'Other' user on the Application Pool rather than being recognised as a built-in account. My PS looks like this currently: Set-ItemProperty $iisAppPoolDir -name processModel -value @{userName="NetworkService";identitytype=3}

Now this usually should also have the password="*****"; field available to allow me to create the application pool and have the user log in. I've left this out, hoping it would be identifiable, but it's not worked.

Any help appreciated!

like image 576
adamwri Avatar asked Mar 10 '15 14:03

adamwri


People also ask

What is apppoolidentity in IIS?

If the "AppPoolIdentity" identity type is selected (the default on Windows 7 and Windows Server 2008 R2, and later), IIS will run worker processes as the application pool identity. With every other identity type, the security identifier will only be injected into the access token of the process.

What is get-iisapppool cmdlet?

The Get-IISAppPool cmdlet gets information about application pools and their current status and other key information. If a specific application pool or a comma delimited list of application pools are requested, only those whose names are passed as an argument are returned.

How do I get the configuration information for an IIS application pool?

Gets configuration information for an IIS Application Pool. The Get-IISAppPool cmdlet gets information about application pools and their current status and other key information. If a specific application pool or a comma delimited list of application pools are requested, only those whose names are passed as an argument are returned.

What is pool identity in IIS 7?

Application Pool Identity Accounts. Worker processes in IIS 6.0 and in IIS 7 run as Network Service by default. Network Service is a built-in Windows identity. It doesn't require a password and has only user privileges; that is, it is relatively low-privileged.


1 Answers

Network Service is its own identityType, so you would not set a username at all, and instead set the identityType to 2, like this:

Set-ItemProperty IIS:\AppPools\MyAppPool -name processModel.identityType -value 2

This will set the identity to Network Service.

The identityType values are documented on the IIS website.

like image 101
vcsjones Avatar answered Sep 28 '22 13:09

vcsjones