We help IT Professionals succeed at work.

Help with Creating websites in IIS programatically using ASP and wmi

308 Views
Last Modified: 2008-01-09
I know that one can create IIS websites by calling a wmi script from an asp page, the problem is I cannot find any examples that will allow me to create slightly more complicated settings in IIS. I need to write a script that will create about 1200 already working sites on a new server with different settings than are on my current web server.

All the sites use the same Anonymous user.
All sites map to a directory on a remote server and need to authenticate as a specific user
The following is a sample IIS record that I need duped for all sites:

<IIsWebServer      Location ="/LM/W3SVC/865928396"
            AllowKeepAlive="FALSE"
            AuthFlags="0"
            LogFileDirectory="c:\domains\mydomain.com\logs"
            LogFileLocaltimeRollover="FALSE"
            LogFilePeriod="1"
            LogFileTruncateSize="20971520"
            LogPluginClsid="{FF160663-DE82-11CF-BC0A-00AA006111E0}"
            LogType="0"
            ServerAutoStart="TRUE"
            ServerBindings="192.168.111.111:80:mydomain..com
                  192.168.128.139:80:www.mydomain.com"
            ServerComment="mydomain.com"
      >
</IIsWebServer>
<IIsFilters      Location ="/LM/W3SVC/865928396/filters"
            AdminACL="49634462f0000000a40000004000000060b793598a58a37b8e66c988e2068b5bba50ab26d7ddd0f3ba1973a26f20e3a4762fdcab906ec150b1384db5c3094123c7abbb4c3ffa2733e92371ae199fff1389b2f3cc06b684fd0e6ff40c8d0b812018cc3974aeb756397b4c113026048aa904afd7301b45cfb70b6f23c88f84c97c81b50b8c3d48c41e3d734523bee62f926f96c210a9b38bf0cc6f905727c0191ee64c829184dd61c572313259e439b2f4cabebc213a13f298c635771905effb807ed895bc224c6707e9608cc2d99a6a7a570bd37f930b31a8adb9f8347dbce6722a8d509b361daeb98e450ce9a65774056664e09908137d92"
      >
</IIsFilters>
<IIsWebVirtualDir      Location ="/LM/W3SVC/865928396/root"
            AccessFlags="AccessRead | AccessScript"
            AnonymousPasswordSync="TRUE"
            AnonymousUserName="someuser_web"
            AnonymousUserPass="4963446...truncated"
            AppAllowClientDebug="TRUE"
            AppFriendlyName="mydomain.com"
            AppIsolated="2"
            AppPoolId="DefaultAppPool"
            AppRoot="/LM/W3SVC/865928396/ROOT"
            AuthFlags="AuthAnonymous | AuthNTLM"
            DefaultDoc="Default.asp,index.htm,Default.htm,Default.aspx"
            DirBrowseFlags="DirBrowseShowDate | DirBrowseShowTime | DirBrowseShowSize | DirBrowseShowExtension | DirBrowseShowLongDate | EnableDefaultDoc"
            Path="\\SP4771\websites$"
            ScriptMaps=".asa,C:\Windows\system32\inetsrv\ASP.DLL,1,GET,HEAD,POST,TRACE
                  .asp,C:\Windows\system32\inetsrv\ASP.DLL,1,GET,HEAD,POST,TRACE
                  .cdx,C:\WINDOWS\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE
                  .cer,C:\WINDOWS\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE
                  .cgi,C:\perl\bin\perl.exe &quot;%s&quot; %s,5,GET,HEAD,POST,TRACE
                  .idc,C:\WINDOWS\system32\inetsrv\httpodbc.dll,5,GET,POST
                  .pl,C:\perl\bin\perl.exe &quot;%s&quot; %s,5,GET,HEAD,POST,TRACE
                  .plx,C:\perl\bin\perl.exe &quot;%s&quot; %s,5,GET,HEAD,POST,TRACE
                  .shtm,C:\WINDOWS\system32\inetsrv\ssinc.dll,5,GET,POST
                  .shtml,C:\WINDOWS\system32\inetsrv\ssinc.dll,5,GET,POST
                  .stm,C:\WINDOWS\system32\inetsrv\ssinc.dll,5,GET,POST"
            UNCPassword="4963446...truncated"
            UNCUserName="someuser_web"
      >
</IIsWebVirtualDir>
<IIsWebDirectory      Location ="/LM/W3SVC/865928396/root/CGI-BIN"
            AccessFlags="AccessExecute | AccessRead"
      >

Can someone please write the script for me so I can pass it the domain from an ASP page (asp classic using vbscript)? I am clueless to take this any further.
500 points if you can make it create forward and secondary DNS records for MS DNS server on the same machine.

MUCH APPRECIATED!!!!!!!!!!
Comment
Watch Question

Top Expert 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Sorry this does not do what I need. But thanks.

Author

Commented:
Upon further review, I was able to modify these scripts. Thanks!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.