Use PowerShell to Create AppPool does not set AppPool Identity Use PowerShell to Create AppPool does not set AppPool Identity powershell powershell

Use PowerShell to Create AppPool does not set AppPool Identity


You will need to change the Process Model identity type to accept a user account instead of the default ApplicationPoolIdentity and this can be done as follows:

Set-ItemProperty -Path IIS:\AppPools\TestAppPool -Name processmodel.identityType -Value 3Set-ItemProperty -Path IIS:\AppPools\TestAppPool -Name processmodel.username -Value Domain\UserNameSet-ItemProperty -Path IIS:\AppPools\TestAppPool -Name processmodel.password -Value MyPassword

I hope this helps.


I came across this after needing to set the appPool to NetworkService and for anyone else needing to do this, here is the syntax for IIS 7.5 to set your appPool to NetworkService

$pool = get-item("IIS:\AppPools\YOURAPPPOOLNAME");$pool | Set-ItemProperty -Name "ProcessModel.IdentityType" -Value 2

Note: In IIS 7.5, NetworkService was switched from value 3 to value 2.

More information about Process Model can be found here: http://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel


above never worked for me, this did:

import-module webadministration$pool = Get-Item "IIS:\AppPools\apppoolname"$pool.processmodel.identityType = 3$pool.processmodel.username  = "username"$pool.processmodel.password = "password"$pool | set-item