Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


September 2002

IIS Informant: Using MetaEdit 2.2 to Resequence Virtual Directories

RSS
Subscribe to Windows Web Solutions | See More Virtual Directories Articles Here | Reprints
Or get the Monthly Online Pass—only $5.95 a month!

I have a Web site with about 50 virtual directories listed in order of creation. I could manage the virtual directories more easily if I could sort them alphabetically, but I haven't figured out how to do so. When I try to sort the virtual directory list in the Microsoft Management Console (MMC) Internet Information Services snap-in by selecting the Name field in the right pane, the listings remain sorted by creation date. Can you help?

You'll find that MMC behaves a bit differently depending on which version you have. All versions let you sort on the Name column in the details pane—at least sort of. In version 1.0 (Windows NT 4.0), the names are sorted alphabetically but gathered by type. In version 1.2 (tested on Windows 2000), the names are sorted alphabetically but the virtual directories are intermingled with files and regular folders.

What's stranger still is that although the Internet Information Services snap-in doesn't list virtual directories alphabetically, they appear alphabetically when you use MetaEdit to view the metabase. All this confusion aside, you can resequence your directories relatively painlessly—although the process is somewhat tedious.

Use MetaEdit 2.2 to export your metabase settings to a text file. You can then manipulate the text file to resequence the virtual directories and reimport your reorganized settings. To do so, first back up your metabase. Then, open MetaEdit and open the Root key of the Web site instance number. For example, start MetaEdit, and in the left panel, expand LM, W3SVC, then Web site instance 1 to display the Default Web Site for a default installation.

To find which of the Web site numbers is the correct one for the Web site, you can use trial and error. Select an instance, then in the right-hand pane, locate the Web site name, which is in the Data field of the metabase key with the name ServerComment. When you find the correct Web site name, you've found the Web site number. For example, Figure 2 shows that 1 is the Web site number for the Default Web Site. You can also find the Web site number through a script in the Adminscripts folder called FindWeb.vbs. If you provide FindWeb.vbs with the name of a Web site, it returns information about the site including the Web site number. On a default installation, you can type

c:\inetpub\adminscripts  findWeb.vbs "Default Web Site"

at a command prompt, which would return

Web Site Number = 1
  Web Site Description =
    Default Web Site
    Hostname =
    Port = 80
    IP Address =

After you identify the Web site number, you can locate the Root key in the Web site's metabase, which Figure 2 shows. When you open this key, you see the listings for virtual directories as well as for other directories and possibly for files. With the Root key selected, as Figure 3 shows, select Metabase, Export Text File, and provide a path and a name for the text file that will contain the Root key settings.

Using Notepad, open the text file and examine the contents. Note the well-organized structure, which contains the exported Root key. You can easily identify the virtual directory definitions because they have this structure:

[/LM/W3SVC/<Web site number>
  /Root
  /<virtual directory name>]

On my demonstration server, for example, I have [/LM/W3SVC/1/Root/Certsrv] and [/LM/W3SVC/1/Root/Demos]. Carefully copy the definitions in the directory listing sequence you desire. Make sure you have only one blank line between each listing.

After you complete the reorganization, save the text file. Although nothing we've done so far has placed the metabase itself at risk of being changed, that all ends here.

At this point, stop all Web services. In IIS 5.0, you use the IISRESET /STOP command. In IIS 4.0, you stop the IIS Admin Service by using NET STOP IISADMIN. Close MetaEdit, then open the Internet Services Manager console and locate the Web site you want to reorganize. Delete the Web site's virtual directories, then close the console.

Open MetaEdit and import the modified text file. Close MetaEdit, then open the Internet Services Manager console again. Your virtual directories are now in the sequence you specified. Restart the Web server.

Despite the work required to gain the benefit, if your IIS directory structure is relatively stable and you reference it frequently, the effort might be worth it. A couple of quick caveats about this technique: I don't like to have both the Internet Services Manager console and MetaEdit open at the same time. Because both update the same data store, you don't want older information from one of the applications to update the metabase while you're editing in the other application. Note that if you use MetaEdit 2.1 (which is included in the Microsoft Windows 2000 Resource Kit), editing the metabase with both tools open can cause the server to be unstable (i.e., blue screen). You should use MetaEdit 2.2, which you can download at http://downloadmicrosoft.com/download/iis50/utility/5.0/nt45/en-us/mtaedt22.exe.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

Q. How can I use the command line to obtain a list of all the applications installed on my computer?

...

Windows SBS, EBS 2008 Hit RC1, Home Server PP1 Ships

Find out how to download the RC1 versions of Windows SBS 2008 and EBS 2008, and discover what's new in the PP1 update to Windows Home Server. ...


IIS and Web Administration Whitepapers The Five Secrets to Controlling Your SharePoint Environment

Extended Validation SSL Certificates

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Related IIS and Web Administration Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Shortcut Guide to SQL Server Infrastructure Optimization
With right tools and techniques, you can have a top-performing SQL Server infrastructure without having to cram your data centers so that they're overflowing. Download this eBook to learn how.

WinConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

Become a fan of Windows IT Pro on Facebook!
Join us on Facebook and be a fan of Windows IT Pro!

Continuous Data Protection and Recovery for Exchange
Read this white paper to learn about Continuous Data Protection (CDP), Exchange 2007's local continuous replication and cluster continuous replication features.

Rev Up Your IT Know-How with Our Recharged Magazine!
The improved Windows IT Pro provides trusted IT content with an enhanced new look and functionality! Get comprehensive coverage of industry topics, expert advice, and real-world solutions—PLUS access to over 10,000 articles online. Order today!

Tips to Managing Messaging
Discover three fundamental mail and messaging management services - security, availability and control services - and how you can implement them in a Microsoft-centric mail and messaging environment.

Get It All with Windows IT Pro VIP
Stock your IT toolbox with every solution ever printed in Windows IT Pro and SQL Server Magazine plus bonus Web-exclusive content on hot topics. Subscribe to receive the VIP CD and a subscription to your choice of Windows IT Pro or SQL Server Magazine!



Solving PST Management Problems
In this white paper, read about the top PST issues and how to administer local/network PST files.

Bandwidth Monitoring Tool from SolarWinds
Identify largest bandwidth users in seconds. Get the free download now.

Transform Your Data Center at Brocade Conference 2008
Storage networking industry’s premier event at the MGM Grand, Las Vegas, September 22 - 24, 2008

Are You Litigation Ready?
Collecting and processing electronic data for e-discovery can be time-consuming and expose a business to significant legal risks. Get prepared with this free white paper

Order Your Fundamentals CD Today!
Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.

KVM over IP Solutions
Learn about a KVM over IP solution that is specifically designed to meet the needs of the distributed IT environment.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound
IT Library Technical Resources Directory Connected Home Windows Excavator SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing