I have a problem with creating a web application and application pool.

I use this code:

New-SPWebApplication -Name $Name -Port $port -HostHeader $header -URL $url -ApplicationPool $ppn -ApplicationPoolAccount (Get-SPManagedAccount $ppa)

Normally it create a application pool with web application and everything is OK, but after few times deleting and recrating it I get now an error now and it says that Application Pool already exists. Although when I deleted the web application I've deleted the Application Pool and Databases if the web application had sites.

I thought i would delete it manually, the application pool, but i cannot find it, where it exists? I've checked in IIS, i've checked in applicationHost.config, I don't understand where the traces of that application pool can be.

When i try to create a web application and to choose that name, it says access is denied. I think the application pool is corrupt.

I've tried to restart the server as well, it did not help.

Anyone maybe can advise?

  • 1
    Did you try to recycle the IIS using IIS_RESET before trying to create the account again?
    – Benny Skogberg
    Dec 10, 2018 at 9:56

1 Answer 1


What i am suspecting, it is either corrupt or stuck in the memory which is causing the issue. I would try below steps:

  • Go to service console on Server -> Stop & Start World wide web service. Peform this on all server in the SharePoint farm
  • Stop the IIAdmin service using the command line NET STOP iisadmin /y and Start it NET START iisadmin, Perform it on all servers in SharePoint Farm.
  • Also check the Central admin and if you can see any traces over here. goto >Central admin > Security > Configure Service Accounts > on this page, click on Select an account for this component and make sure that App Pool not listed here.
  • Also Close the PowerShell cosnole and reopen it as Admin.
  • at the end may be you need to clear the configuration cache on the SharePoint servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.