SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

How to remove the Central Admin web app from IIS?

I am using SharePoint 2010 on Windows Server 2012.

I know I can remove an app with the SharePoint 2010 Management Shell by issuing:

Remove-SPWebApplication –identity http://sitename -Confirm

but when I replace http://sitename with the URL to the Central Admin web app http://myserver:46828 I am told: Cannot find an SPWebApplication object with Name, Id, or Url: http://myserver:46828.

share|improve this question
Why would you want to remove THAT?? That's a weird question. – bgmCoder May 1 '13 at 2:26
@BGM: I was told to do this, if I understood well it is the first step described in this answer: – Nicolas Raoul May 1 '13 at 2:46
Ah, so you are trying to uninstall Sharepoint Server so you can reinstall it afresh? – bgmCoder May 1 '13 at 14:25
up vote 2 down vote accepted

If you want to remove Central Administration, you can use this script:

Write-Host "Removing central administrations:"
$applications = Get-SPWebApplication -IncludeCentralAdministration | where-object {$_.IsAdministrationWebApplication -eq $true }
if($applications -eq $null)
    Write-Host "No central administrations found."
foreach($application in $applications)
    Write-Host "$($application.Url)"

    # for central administration web application Remove-SPWebApplication cmdlet requests confiramtion
    # even if parameter '-Confirm:$false' is used

    # Remove-SPWebApplication $application -DeleteIISSite -RemoveContentDatabases -Confirm:$false 
    Write-Host "`t removing iis site"

    Write-Host "`t removing databases"
    foreach ($contentDb in $application.ContentDatabases)

share|improve this answer
Thanks! Unfortunately I get An expression was expected after '('. for the final line. Adding a semicolon does not solve the problem either. Also, WriteFuncInfo has only 9 results on Google, and returns CommandNotFoundException. – Nicolas Raoul May 1 '13 at 8:18
Then replace them with Write-Host. – Robert Lindgren May 1 '13 at 13:23
Write-Host solves the second problem. To solve the first problem, I just removed the function. Benny, I edit your solution to reflect what worked for me, OK? – Nicolas Raoul May 7 '13 at 5:16
@NicolasRaoul Great! Thanks for the team work! :-) – Benny Skogberg May 7 '13 at 9:50

If you want to remove or add Central Administration from/to IIS on specific hosts, just use

psconfig.exe -cmd adminvs -unprovision


psconfig.exe -cmd adminvs -provision

on these hosts.

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.