How to specify application pool identity user and password from PowerShell
I have been having lots of difficulty automating the setup of a Web application and configuring IIS appropriately with the Application Pool Identity. I am doing this in a Web application deployment script written in PowerShell. My requirement is that I need my PowerShell script to set the application pool identity user to a specific service account mydomain\svcuser and password. Here is the sample code: $pool = New-Item "IIS:\AppPools\MyAppPool" -Force $svcuser = "mydomain\svcuser" $pool.processModel.userName = $svcuser $password = "somepassword" $pool.processModel.password = $password $pool