Question: I have an application in one of my application pools that has a virtual path of `/Site/login.aspx`. I want to remove it but it no longer exists on my computer and it's causing me issues setting up AppFabric.

I understand that you can remove these phantom applications by recreating the application in IIS and then hitting Remove. That will get rid of the application from the pool but in this case I can't recreate the application due to the `/login.aspx` in the virtual path

Any ideas how I remove this erroneous entry?

Answer: 
Child applications aren't automatically deleted and the IIS Manager can't display them in the tree, so that's your problem...

A quick and robust way is to use a PowerShell script to get all applications, test whether the physical path still exists and if not, delete the application:

```
# This is for IIS 7, make sure the snap-in is installed first: https://www.iis.net/downloads/microsoft/powershell
Add-PSSnapin WebAdministration

# Get all IIS sites
Get-ChildItem IIS:\Sites | foreach {
    $site = $_;

    # Get all applications without existing physical path
    $applications = Get-ChildItem $site.PsPath | Where-Object { $_.NodeType -eq "application" -and (Test-Path $_.PhysicalPath) -eq $False };

    # List all phantom applications
    $applications | FT

    # Remove applications
    $applications | Remove-WebApplication -Site $site.Name
}

```
I did a combination of two answers listed above since I did not want to tinker applicationHost.config manually.

Step 1 - Create a temporary app pool - let's say "temp". 

Step 2 -
 Move all the phantom applications to this temp app pool. 

Step 3 - Use Powershell from one of the answers above -

```
Powershell  
PS C:\Windows\system32> import-module WebAdministration
PS C:\Windows\system32> iis:
PS IIS:\> cd .\AppPools
PS IIS:\AppPools> ls
PS IIS:\AppPools> del [name of phantom AppPool]  

```

Voila!