Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Great script. Even though this isn't really a question, I modified it somewhat for batch processing.</p> <p>First, I created a batch file that reads in a text file of websites to add, that references your slightly modified batch file to only create websites (no FTP's required):</p> <pre><code>@Echo off :: --------------------------------------------------------------------------------------- :: Create Batched IIS 7 Site Entries :: :: Usage: CreateIISEntry.bat [websitename.com] (no www.) :: for /f %%X in (NewWebsiteEntries.txt) do CreateSingleIISEntry.bat %%X echo ... echo *** BATCH PROCESS HAS BEEN COMPLETED *** </code></pre> <p>NewWebsiteEntries.txt contains a list of websites to create - one per line (no www. included):</p> <pre><code>site1.com site2.com site3.com </code></pre> <p>Lastly, the batch file that creates the entries: </p> <pre><code>@Echo off :: --------------------------------------------------------------------------------------- :: Create IIS 7 Site Entry :: :: Usage: CreateSingleIISEntry.bat [websitename.com] (no www.) :: --------------------------------------------------------------------------------------- :: Get variable from command %1 Root Domain Name. set rootDomainName = %1 :: This is the path to the Web Pages on the server. set WebFile=C:\inetpub\wwwroot\ :: ADD NEW Directory MKDIR %WebFile%%1 echo New Directory Created: %WebFile%%1 xcopy C:\inetpub\wwwroot\NewWebsiteHolding\*.* %WebFile%%1 :: ADD IIS ENTRY %windir%\system32\inetsrv\AppCmd ADD SITE /name:%1 /bindings:http/[YOUR IP ADDRESS OR *]:80:%1,http/[YOUR IP ADDRESS OR *]:80:www.%1 /physicalPath:%WebFile%%1 echo IIS Website Created: %1 and www.%1 #:: -------------------------------------------- #:: CREATE FTP in IIS #:: -------------------------------------------- #%windir%\system32\inetsrv\AppCmd add vdir /app.name:"Default FTP Site/" /path:/%1 /physicalPath:"%WebFile%%1" # # #echo FTP SITE Created: %1 echo ... echo ... echo New website added ========================= %1 </code></pre> <p>Since in my case, not all the new sites will be live at once, I a default placeholder site who's contents are copied into the newly-created website directories.</p> <p>This will add all sites to the default app pool.</p> <p>That's about it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload