So you want to change the location of IIS files or directories with Windows 2003?
How do I do that, you ask? Well, it sort of depends on what you need to
change. It also depends on whether you have Exchange installed. Let's
assume that you do for the purposes of this exercise, though I'll
include information on how to change them if you don't.
Changing SMTP information:
Some of the SMTP locations can be changed from within Exchange System
Manager. These include the Badmail Directory and the Queue directory.
To change these 2 locations, simply navigate to the Server, Protocols,
SMTP, Default SMTP Virtual Server and go to the properties. Then, go to
the Messages Tab. You will see locations where you can browse and
select the directory for the Badmail and Queue directories. However,
this doesn't allow you to change the Pickup directory. While there may
not be much need to change it, you may still want to for the sake of
organization. For a server that has Exchange installed, this
information is stored in Active Directory, and as such, should be
modified there rather than in the IIS metabase.
Exchange uses a documented process called DS2MB (Directory Service to
MetaBase) to replicate information from Active Directory (such as
Default Domain setting on Exchange Virtual Server, etc.) into the IIS
Metabase. If the SMTP Pickup directory is modified using MetaEdit
(Windows 2000) or by modifying the XML file (Windows 2003), it is
possible that the DS2MB process will overwrite those values with those
that are stored in Active Directory. For this reason, as a rule of
thumb if the attribute is stored in Active Directory (as well as the
Metabase), it should be modified in Active Directory.
http://support.microsoft.com/?kbid=822933 (How to change the Exchange
2003 SMTP Mailroot folder location) is a good reference for this for
Windows 2003/Exchange 2003.
http://support.microsoft.com/kb/318230/ (How to change the Exchange 2000
SMTP Mailroot directory location) is the Windows 2000/Exchange 2000
version.
Note that both articles reference rebooting the Exchange server at the
end. I don't think that step is actually required, and would prefer not
to restart a server, but I leave that to your discretion.
What if you don't have Exchange installed?
If you recall, with Windows 2000 (IIS 5.0), if you wanted to modify this
information, you had to do this with MetaEdit, which allowed you to
directly modify the IIS Metabase (Metaedit looks similar to a registry
editor). Well, with Windows 2003, MetaEdit is no longer necessary.
Now, the entire IIS metabase is stored in an XML file (yes, that's
right, XML). This XML file is located in the
c:\windows\system32\inetsrv directory and is called metabase.xml. Just
open it with your favorite text editor (I prefer EditPad Lite or Notepad2, both free for personal
use, and much more functional than notepad itself) and if you scroll
down far enough (or search for it), you will see information such as
below. The IIsSmtpServer Location section contains information related
to each SMTP Virtual Server. The first one is, aptly enough, instance
1, thus the SmtpSvc/1. Under there are several options. One of them,
shown below, shows the Pickup Directory. The example shown below makes
reference to Exchange, so the path would be different on a standalone
SMTP server. Simply make the change, save the xml file, and restart the
appropriate service(s), or perform an IISReset. Or, if you are brave
:-) you can enable direct metabase editing, which will apply the changes
on the fly. Note that even on standalone SMTP servers, some information
may be available to modify using IIS Manager, but if you are going to be
changing several values, it may be easier to simply modify the XML file.
IIsSmtpServer Location ="/LM/SmtpSvc/1"
Name="PickupDirectory"
ID="36880"
Value="C:\Program Files\Exchsrvr\Mailroot\vsi 1\PickUp"
Type="STRING"
UserType="IIS_MD_UT_SERVER"
Attributes="NO_ATTRIBUTES"
Changing NNTP information:
In the same XML file, you'll find the NNTP Virtual Server Settings.
While most people running Exchange probably don't configure NNTP, if you
do, you may have a desire to change this information. Keep in mind that
by default, NNTP newsgroups are actually stored in Public Folders, so
you won't find them in a local directory. As with SMTP, if you find any
of these settings in Exchange System Manager, or in Active Directory,
they should be modified there rather than the IIS Metabase. I believe
you'll find the virtual directory information within Exchange System
Manager, but I didn't see much else.
IIsNntpServer Location ="/LM/NNTPSVC/1"
AllowControlMsgs="FALSE"
ArticleTableFile="C:\Inetpub\nntpfile\article.hsh"
GroupHelpFile="C:\Inetpub\nntpfile\descrip.txt"
GroupListFile="C:\Inetpub\nntpfile\group.lst"
GroupVarListFile="C:\Inetpub\nntpfile\groupvar.lst"
HistoryTableFile="C:\Inetpub\nntpfile\history.hsh"
ListFile="C:\Inetpub\nntpfile\listfile.hsh"
MaxConnections="5000"
ModeratorFile="C:\Inetpub\nntpfile\moderatr.txt"
NTAuthenticationProviders="NTLM"
NewsDropDirectory="C:\Inetpub\nntpfile\drop"
NewsFailedPickupDirectory="C:\Inetpub\nntpfile\failedpickup"
NewsPickupDirectory="C:\Inetpub\nntpfile\pickup"
PrettyNamesFile="C:\Inetpub\nntpfile\prettynm.txt"
SecureBindings=":563:"
ServerAutoStart="FALSE"
ServerBindings=":119:"
ServerComment="Default NNTP Virtual Server"
XoverTableFile="C:\Inetpub\nntpfile\xover.hsh"
IIsNntpVirtualDir Location ="/LM/NNTPSVC/1/ROOT/_slavegroup"
Path="C:\Inetpub\nntpfile\root\_slavegroup"
VrDriverProgid="NNTP.FSPrepare"
IIsNntpVirtualDir Location ="/LM/NNTPSVC/1/ROOT/control"
Path="C:\Inetpub\nntpfile\root\control"
VrDriverProgid="NNTP.FSPrepare"
Changing Website information
Ok, so we've talked about both SMTP and NNTP. How do you change the
directory for the Default website? That's quite a bit easier. Simply
open IIS Manager, go to the properties of the default website, and
modify the Home Directory to point to the new path you designate.
Though you are prompted to specify the location of the Home Directory
for all new websites created, this same method applies to any websites
that you may want to move to another volume. Don't forget to copy the
contents of your old website to the new location prior to changing it in
IIS Manager :-)
Worth noting is that you need to be careful of any changes that might be
propagated to virtual directories underneath the website.
Exchange-specific virtual directories correspond to special locations
that you don't want to change :-)