Server Fault is a question and answer site for system and network administrators. 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

I would like to quickly be able to check whether a site is online after logging into the desktop of Windows Server 2008 R2 (x64). I would prefer to be able to do this in just 1 single or double-click (or better yet, without clicking at all) than to have to navigate the tree structure of the IIS Manager.

I can make a shortcut to IIS Manager and put it on my desktop, but how do I force it to open to the SERVERNAME/Sites view rather than clicking several times to get there?

If it can't be done, is there some other way without doing programming that I can put an "online/offline" indicator (preferably in the system tray or on the desktop) for each site I want to put there?

If I have to resort to programming for this seemingly simple feature, how can I get the status (started or stopped) for a specific IIS web site to be shown in my custom program? What API, file, or registry entry do I need to read to get this status info?


I discovered someone else with a .bat file that used the appcmd.exe IIS utility. After some trial and error after reading the MSDN documents about the appcmd.exe utility, I was able to piece together the following .bat file that does the job nicely. The task at hand was simply to get a site (or multiple site's) state in 2 clicks or less from the desktop.

@echo off

FOR /F "tokens=*" %%A IN ('%SystemRoot%\System32\inetsrv\appcmd list site / /text:state ^| FIND "Started"') DO SET STATUS1=STARTED

FOR /F "tokens=*" %%A IN ('%SystemRoot%\System32\inetsrv\appcmd list site / /text:state ^| FIND "Started"') DO SET STATUS2=STARTED

echo %STATUS1%
echo %STATUS2%


Unfortunately, the utility is not documented very well - I had to tinker with it quite a bit to get the result I wanted.

%SystemRoot%\System32\inetsrv\appcmd list site /

This is the line that gets the status, but running it like this returns a bunch of other stuff too. So, in order to just get the status and nothing else, another parameter must be added.

%SystemRoot%\System32\inetsrv\appcmd list site / /text:state

Following the example in the link, I was also able to put together a menu to instantly start and stop the sites by pressing a key and then ENTER, and then it displays the status of the sites again - all from one .bat file.

share|improve this question

If you have the 'IIS Management Scripts and Tools' enabled, you can use PowerShell to show the status of the sites. I use a script like this in a dedicated PowerShell window:

     Get-ChildItem IIS:\sites | format-table state, name
     $curPos = $Host.UI.RawUI.CursorPosition
     $ou = (Get-Date).ToString("HH:mm:ss")
     $ou = "  " +  $ou + " - Press CRTL+C to terminate"
     Start-Sleep -Seconds 5
} until ($false)

The line

Get-ChildItem IIS:\sites | format-table state

does the real work, the rest is just there to keep the output from scrolling. It updates every five seconds.

share|improve this answer

I am sorry to say, but the short answer is no. Check out the configuration reference here: or the cmdlet reference here:

I checked out the XML file, but there is nothing that allows you to choose where you start. They really should add that.

share|improve this answer
Thanks for looking into this. However, as they say there is more than one way to skin a cat. I found a solution to getting this info by using the appcmd.exe IIS utility. – NightOwl888 May 21 '11 at 16:09
I am glad you found a work around. – KCotreau May 21 '11 at 20:29

Did you try appcmd.exe list sites, the output is something like

SITE "Default Web Site" (id:1,bindings:http/*:80:,state:Started)

You can refer the article

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.