Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know there are scripts available on the Microsoft website to have an unattended installation of IIS, but I was wondering if there is anyone who can help me out with a script to have an unattended uninstall of IIS?

Thank you!!

share|improve this question

On Server 2008 you have two tools to install and un-install Windows components ocsetup.exe and pkgmgr.exe.

When calling any of it, you need to specify the name of the component to un-install.

On 2008 I don't know how to get a list of the installed components, so you can just un-install any possible components.

The following would un-install the components I usually use:

start /w pkgmgr.exe /quite /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-HttpErrors;IIS-HttpRedirect;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-Security;IIS-WindowsAuthentication;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-ApplicationDevelopment;IIS-NetFxExtensibility;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-DirectoryBrowsing;IIS-ManagementConsole

However you may have other IIS components installed. In theory when specifying IIS-WebServerRole related components should be un-installed as well. I haven't tested any of this because I don't have a 2008 Server anymore.

You can find a full list of the component names on Technet, just include any component you need to un-install.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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