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?