Stopping IIS
If you temporarily don't use IIS, you can 'turn it off'.
Optionally, stop all web sites, ftp sites and application pools:
ls iis:\sites | stop-website -ErrorAction SilentlyContinue ls iis:\sites | % {$_.ftpserver.stop()} ls IIS:\AppPools | Stop-WebAppPoolStop all related services. Please note that WMSVC and ftpsvc may not be installed on your machine.
Stop-Service WMSVC Stop-Service AppHostSvc Stop-Service W3SVC Stop-Service ftpsvc Stop-Service WASDisable the services
Set-Service -Name AppHostSvc -StartupType disabled Set-Service -Name w3svc -StartupType disabled Set-Service -Name ftpsvc -StartupType disabled Set-Service -Name WAS -StartupType disabled Set-Service -Name WMSVC -StartupType disabledYou should see that nobody is listening to any web ports anymore:
netstat -anTo Enable IIS again:
Set-Service -Name AppHostSvc -StartupType Automatic Set-Service -Name w3svc -StartupType Automatic Set-Service -Name ftpsvc -StartupType Automatic Set-Service -Name WAS -StartupType Automatic Set-Service -Name WMSVC -StartupType Automatic Start-Service WAS Start-Service W3SVC Start-Service ftpsvc Start-Service AppHostSvc Start-Service WMSVC ls iis:\sites | start-website -ErrorAction SilentlyContinue ls iis:\sites | % {$_.ftpserver.start()}
Removing IIS
Close IIS Manager if you have it running.Uninstall any IIS Extensions, it's better to do that before uninstalling IIS.
$app = get-WmiObject -Class Win32_Product -namespace "root\cimv2" | Where-object{$_.Name -match "IIS URL Rewrite Module 2"} $app.Uninstall()We can remove most IIS components with the following command:
Uninstall-WindowsFeature -Name Web-Server -restart Uninstall-WindowsFeature -Name Wasor on older Windows versions:
dism.exe -online -Disable-Feature -FeatureName:IIS-WebServer dism.exe -online -Disable-Feature -FeatureName:WAS-WindowsActivationServiceThere are still some files in "C:\Windows\System32\inetsrv","C:\inetpub" and your content directories. Leave "inetsrv" alone, but you can delete the others.