The other default behavior with IISCnfg that I have adjusted
is the unnecessary requirement to put in the username and password of the
target server. IISCnfig makes these required fields, so if you leave them off,
the /copy command will not work. If the user identity running the script has
permission to the target server, it should be able to pass that through to the
target server without requiring you to put the username and password in the
batch file. If you need to put the username/password in the batch file, that
means that you need to maintain it over time and it also means that you have a
username/password in plain text in your batch files or scripts. Fortunately,
it was easy to comment out the requirement to do that and it works perfectly
without it. So, the attached files include IISCnfg2.vbs which has that
modification. I made a comment with my name (Scott Forsyth) beside each line
that I changed so that you can tell what was changed.
Included Files
With the theory behind us, let us take a look at the files
included in the download file. Note that I did not try to pretty it up or put
a lot of error checking in it. It is simple and easy to understand, but that
also means that you may need to do some digging into the files to make any
changes or to troubleshoot any issues that I did not handle in a friendly way.
[The first two files are the ones that you will use to do a
Metabase Merge or Push.] MetabasePush.bat
Usage: MetabasePush {ServerIP} [SMTP FQDN]
You can call this from a batch file that can live somewhere
else, like on the desktop of your primary web server. It will do a metabase
push from the current server (localhost) to the target server specified by the
ServerIP.
You can optionally add the SMTP FQDN and it will update that
on the target server. We use that at ORCS Web because each server node has a
different SMTP FQDN.
MetabaseMerge.bat
Usage: MetabaseMerge {ServerIP} [SMTP FQDN]
This operates the same as MetabasePush except that it does a
Merge instead. The ServerIP is required and the SMTP FQDN is optional. Do not
forget the differences mentioned above between a Push and Merge. This file
calls RemoveAdminACLLine.vbs so that the target server retains its own security
settings.
[The following files are helper files and do not need to be
run directly.]
IIsCnfg2.vbs
This is a copy (confirmed up to date May 2006) of
IIsCnfg.vbs, but with two minor modifications to make the target username and
password optional.
Metaacl.vbs
This is an untouched Microsoft script to view and update the
metabase ACLs permissions.
RemoveAdminACLline.vbs
This is used by MetabaseMerge.bat to remove the ACL lines so
that the permissions on the target server are left untouched during a Merge.
ChangeSMTP-FQDN.vbs
This will change the fully qualified domain name of the SMTP
server on the target server that you specify. It is used when there are
different SMTP DNS names on each server.
readme.txt
I am sure you can guess.
To utilize these scripts, simply extract the set of files to
a folder on your server and then call MetabasePush.bat and MetabaseMerge.bat
from your own batch files. For example, you could create a batch file on the
desktop of your primary web server that has the following in it.
Listing 3
--Metabase Merge.bat--
d:\admin\ClusterUtils\MetabaseMerge.bat 192.168.2.11 web2.domain.com
d:\admin\ClusterUtils\MetabaseMerge.bat 192.168.2.12 web3.domain.com
d:\admin\ClusterUtils\MetabaseMerge.bat 192.168.2.13 web4.domain.com
d:\admin\ClusterUtils\MetabaseMerge.bat 192.168.2.14 web5.domain.com
d:\admin\ClusterUtils\MetabaseMerge.bat 192.168.2.15 web6.domain.com
If you double click on that file, it will do a Merge to the
various servers on a WebFarm. This assumes, of course, that you placed the
files in d:\admin\ClusterUtils\.
Downloads
[Download
Sample]
That is it! I hope that you have found this useful and are
able to utilize parts or all of it in your environment.
Scott Forsyth is Director of IT at ORCS
Web, Inc. - a company that provides managed complex hosting for clients who
develop and deploy their applications on Microsoft Windows platforms.