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?
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:
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.