Contents tagged with MetaBase.xml

  • Where is the IIS Admin Service in IIS 7???

    Question:
    Hello, I am pretty new to IIS 7. I have just recently started working on IIS 7 test boxes at my office. I installed default IIS 7 and was very happy but I think I have missed something as I am not able to find the IIS Admin Service. However, my IIS box seems to be running fine. On my IIS 6 production box I can see the service and IIS 6 does not work at all without the IIS admin Service started. What am I missing?

    It might sound a little new to you but IIS Admin Service in not required in IIS 7 for as long as you are not using IIS Metabase compatibility feature or FTP 6 publishing services.

    The interesting fact is not that IIS can run without IIS admin service, but How ?:)

    This is where you need to understand what is the role of IIS Admin Service and why that is not required in IIS 7. For the basics lets start with what are services in general. Services are basically programs that run in the background performing core operating system functions usually without any required input from the user. IIS Admin Service is one such service where in the user doesn't have to do anything.

    Now coming to what IIS admin service does: IIS Admin service is responsible for managing the metabase (the configuration repository in IIS 5, 6). In IIS 6 metabase is in xml format and can be edited and read in plain text editors like Notepad. The service runs under inetinfo.exe and is governed by iisadmin.dll primarily. IIS admin service makes the metabase available to applications that are dependent on it including IIS core components as well.

    Having said that the implementation of IIS admin service is pretty much the same in IIS 7 except that the configuration of IIS 7 is no more dependent on the Metabase. IIS 7 still stores its configuration in xml format, however, the schema and the depth of configuration and granularity is entirely different from what it was in IIS 6. Therefore IIS metabase is no more required in IIS 7 and exists only for compatibility reasons that is if you wish to install the IIS 6 compatibility components of IIS 7. The configuration is now stored in administration.config and applicationHost.config files which is at c:\windows\system32\inetsrv\config\. If you are familiar with .Net configuration then this will seem like a welcome change to you. IIS 7 configuration can also be governed via web.config files within your apps. For more info on the new architecture model check my previous post.

    Hope this answers your question.

  • Troubleshooting: Could not start the IIS Admin Service on Local Computer

    Q.) When I try to start the IIS Admin Service from services.msc I receive the following error:

    Could not start the IIS Admin Service on Local Computer
    Error2: The system cannot find the file specified.
    At the same time I can also see the following message in the System event log:
    Error: The IIS Admin service terminated with the following error. The system cannot find the file specified

    Source Name: Service Control Manager

    Event ID: 7023
    Ans.)This error usually occurs when the MetaBase.xml file is either missing or has been corrupted. MetaBase.xml is the file wherein the IIS 6 configurations are written to and read from.
    The default location for MetaBase.xml is C:\WINDOWS\system32\inetsrv\ . The default location for MetaBase.xml file back up is C:\WINDOWS\system32\inetsrv\History\
    To solve this problem you can either restore the copy of the MetaBase.xml file (If you have a separate backup) or grab a copy from the History folder and place it in the C:\WINDOWS\system32\inetsrv\ folder. After which rename it to MetaBase.xml. Rename it to MetaBase.xml? Yeah! That's because in the History folder you will find the backup in the form MetaBase_0000000244_0000000000.xml . Subsequently, you will also find backups of the MBSchema.xml in the same format.

    The MetaBase.xml file is backed up whenever you make any configurational changes to websites, application pools or any IIS related settings. By default, C:\WINDOWS\system32\inetsrv\History\ contains 10 most recent backups. However, this property itself can be changed from MetaBase.xml. Here's how to do it,

    Open up Metabase.xml file in your favorite text editor. Now look for the section that says IIsComputer. In this section you will find an entry which says, "MaxHistoryFiles". By default, the value of this property is set to 10. You can change that value to whatever you want. Save the changes and start the IIS Admin Service.

    All said, this is not the recommended way of changing the MetaBase.xml file :) Do not change the Metabase.xml file directly until you are very certain of what you are doing. But, if not this way then how? Very simple, just run the following command from the command prompt:
    cscript.exe adsutil.vbs set /MaxHistoryFiles "12"
    As you can notice I am changing the value of the maximum history file to 12. You can place any number there that you want. Now here's something interesting! There may be cases where in you will open the MetaBase.xml file after running the above command and do not see your change reflected. The changes only reflected after you restart the IIS Admin Service. Well that's because you do not have Enable Direct MetaBase Edit check box selected in the IIS properties. To see the changes take effect instantaneously run this command from the command prompt:
    cscript.exe adsutil.vbs set /EnableEditWhileRunning "1"
    Note: Sometimes after you restart the IIS admin service, the websites are in stopped state and you will have to start them manually to get going.
    Update 21/08/2008: I wouldn't want you to enable Direct Metabase Edit for this scenario, as I figured out that when you use Adsutil.vbs the changes are made into the IN-MEMORY metabase.They will be reflected instantaneously in your environment and will then be written to the physical Metabase.xml after 2 mins.
    Now you are all set to reflect changes as soon as they are made. However never do this on a production box. This was shown for instructional purposes so that we move along quickly. :) To de-select the Enable Direct MetaBase Edit check box run this command
    cscript.exe adsutil.vbs set /EnableEditWhileRunning "0"
    Problem solved and we also know a little about MetaBase.xml file now. Let me know if you have any issues!

    I will soon be coming out with posts on IIS command line utilities and Metabase.xml