Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Bulk domain automation

Add hundreds of domains, sites and bindings to Windows Server IIS with PowerShell

Adding a domain in IIS requires creating the site, physical path, application pool and host-header binding together. The PowerShell script creates an isolated pool, directory, www binding and CSV result for each domain.

Windows Server 2025 IIS 10 PowerShell New-Website Bindings Application Pool
root@eka-server
Import-Module WebAdministration
New-WebAppPool -Name "eka-ornek.com"
New-Website -Name "eka-ornek.com" -Port 80 -IPAddress "*" -HostHeader "ornek.com" -PhysicalPath "C:\inetpub\siteler\ornek.com" -ApplicationPool "eka-ornek.com"
New-WebBinding -Name "eka-ornek.com" -Protocol http -Port 80 -HostHeader "www.ornek.com"
100+Sites and host bindings
PoolIsolation per domain
NTFSControlled file permissions
PSPowerShell automation
01
Architecture decision

Choose the correct hosting model before adding hundreds of domains

Bulk automation should not accelerate a wrong architecture. Decide customer isolation, resource limits, application roots, mail and DNS ownership first.

01

Separate IIS site per domain

The clearest model when domains need separate pools, roots, logs and runtime settings.

02

Multiple bindings on one site

For alias domains serving the same application, adding host-header bindings to one site uses fewer resources.

03

Shared or separate app pool

Low-traffic sites in the same trust boundary can share a pool; separate identities and pools are recommended for different customers.

04

SNI-based HTTPS

For many HTTPS sites on one IP, define hostname and SNI bindings before certificate automation.

02
Prerequisites

Requirements to complete before the bulk operation

Windows Server 2019, 2022 or 2025 with the IIS role installed01
An elevated PowerShell session02
WebAdministration or IISAdministration module03
One domain per line in C:\Eka\domainler.txt04
Sufficient NTFS capacity and backup for C:\inetpub\siteler05
A firewall, DNS and certificate plan for ports 80/44306
03
Implementation order

A controlled and recoverable bulk-add workflow

01

Verify IIS role and module

Confirm that the Web-Server role, management tools and PowerShell cmdlets are installed.

Get-WindowsFeature Web-Server,Web-Mgmt-Tools
Get-Module -ListAvailable WebAdministration,IISAdministration
02

Inventory existing sites and bindings

Detect duplicate site names, host headers or port conflicts before the operation.

Import-Module WebAdministration
Get-Website
Get-WebBinding
03

Run a two-domain pre-test

Verify NTFS permissions, application-pool startup and binding matching.

Get-Content C:\Eka\domainler.txt -TotalCount 2 | Set-Content C:\Eka\domainler-test.txt
04

Prefer signing over weakening execution policy

In production, sign the script or use process scope instead of permanently setting ExecutionPolicy to Bypass.

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
05

Run the bulk script as administrator

Site, pool, folder and binding creation results are stored in CSV.

PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Eka\iis-toplu-domain.ps1
06

Verify IIS configuration and HTTP response

Test with Get-Website, Get-WebBinding and a local Host-header request.

Get-Website | Select Name,State,PhysicalPath
Invoke-WebRequest -Uri http://127.0.0.1 -Headers @{Host="ornek.com"} -UseBasicParsing
04
SSH, CLI and API

Copy-ready commands and complete automation script

01

Complete IIS PowerShell script

Creates a site, app pool, directory, www binding, NTFS permission and CSV record for every domain.

$ErrorEylemi = "Stop"
$DomainDosyasi = "C:\Eka\domainler.txt"
$WebKoku = "C:\inetpub\siteler"
$SonucDosyasi = "C:\Eka\iis-domain-sonuclari.csv"
$ErrorDosyasi = "C:\Eka\iis-domain-errorlari.log"

$ErrorActionPreference = $ErrorEylemi
Import-Module WebAdministration

New-Item -ItemType Directory -Path (Split-Path $SonucDosyasi) -Force | Out-Null
New-Item -ItemType Directory -Path $WebKoku -Force | Out-Null
"domain,durum,site,uygulama_havuzu,fiziksel_yol" | Set-Content -Path $SonucDosyasi -Encoding UTF8
"" | Set-Content -Path $ErrorDosyasi -Encoding UTF8

Get-Content $DomainDosyasi | ForEach-Object {
    $Domain = $_.Trim().ToLowerInvariant()
    $Domain = $Domain -replace '^https?://','' -replace '^www\.','' -replace '/.*$',''

    if ([string]::IsNullOrWhiteSpace($Domain)) {
        return
    }

    if ($Domain -notmatch '^[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$') {
        "$Domain,gecersiz,,," | Add-Content -Path $SonucDosyasi -Encoding UTF8
        return
    }

    $SiteAdi = "eka-$Domain"
    $HavuzAdi = "eka-$Domain"
    $FizikselYol = Join-Path $WebKoku $Domain

    try {
        New-Item -ItemType Directory -Path $FizikselYol -Force | Out-Null
        "<!doctype html><html lang=`"tr`"><meta charset=`"utf-8`"><title>$Domain</title><h1>$Domain hazır</h1></html>" | Set-Content -Path (Join-Path $FizikselYol "index.html") -Encoding UTF8

        if (-not (Test-Path "IIS:\AppPools\$HavuzAdi")) {
            New-WebAppPool -Name $HavuzAdi | Out-Null
        }

        if (-not (Test-Path "IIS:\Sites\$SiteAdi")) {
            New-Website -Name $SiteAdi -Port 80 -IPAddress "*" -HostHeader $Domain -PhysicalPath $FizikselYol -ApplicationPool $HavuzAdi | Out-Null
            New-WebBinding -Name $SiteAdi -Protocol http -Port 80 -IPAddress "*" -HostHeader "www.$Domain" | Out-Null
        }

        & icacls $FizikselYol /grant "IIS_IUSRS:(OI)(CI)(RX)" /T /C | Out-Null
        "$Domain,basarili,$SiteAdi,$HavuzAdi,$FizikselYol" | Add-Content -Path $SonucDosyasi -Encoding UTF8
    }
    catch {
        "$Domain | $($_.Exception.Message)" | Add-Content -Path $ErrorDosyasi -Encoding UTF8
        "$Domain,errorli,$SiteAdi,$HavuzAdi,$FizikselYol" | Add-Content -Path $SonucDosyasi -Encoding UTF8
    }
}

Get-Website | Select-Object Name,State,PhysicalPath,Bindings
Write-Host "Tamamlandı: $SonucDosyasi"
Write-Host "Errorlar: $ErrorDosyasi"
02

Add an alias binding to one site

For domains serving the same application, add a binding instead of a new IIS site.

New-WebBinding -Name "AnaSite" -Protocol http -Port 80 -IPAddress "*" -HostHeader "alias-domain.com"
New-WebBinding -Name "AnaSite" -Protocol http -Port 80 -IPAddress "*" -HostHeader "www.alias-domain.com"
03

IISAdministration module alternative

On systems using the newer module, New-IISSite can create a site with bindingInformation.

Import-Module IISAdministration
New-IISSite -Name "eka-ornek.com" -PhysicalPath "C:\inetpub\siteler\ornek.com" -BindingInformation "*:80:ornek.com"
04

Bulk binding conflict check

List duplicate protocol, IP, port and host combinations.

Get-WebBinding | ForEach-Object { [PSCustomObject]@{ Site=$_.ItemXPath; Protocol=$_.protocol; Binding=$_.bindingInformation } } | Group-Object Protocol,Binding | Where-Object Count -gt 1
05
Operating system and stack

What changes by distribution and web server

Windows Server 2019

WebAdministration is common and stable. Check TLS versions, .NET Hosting Bundle and URL Rewrite based on the application.

  • Get-WindowsFeature Web-Server
  • Get-Module WebAdministration -ListAvailable
  • iisreset /status

Windows Server 2022

A suitable production choice for SNI, modern TLS and current .NET hosting. Monitor app-pool behavior after Windows Update.

  • Get-ComputerInfo | Select WindowsProductName,WindowsVersion
  • Get-WebAppPoolState -Name *
  • Get-TlsCipherSuite | Select-Object -First 10

Windows Server 2025

Use WebAdministration or IISAdministration according to installed role versions and test automation in staging.

  • Get-WindowsFeature Web-Server,Web-Mgmt-Tools
  • Get-Command New-Website,New-IISSite -ErrorAction SilentlyContinue
  • Get-IISSite 2>$null
06
Troubleshooting

Common errors during bulk domain creation

5 entries
Error message

Cannot create a file when that file already exists

The same IIS site name, binding or physical path may already exist.

Error message

Cannot find path IIS:\

WebAdministration may not be installed or PowerShell may not be elevated.

Error message

HTTP Error 500.19

web.config syntax, locked sections, missing modules or NTFS access may be the problem.

Error message

503 Service Unavailable

The application pool may be stopped, Rapid-Fail Protection triggered or the runtime failed to load.

Error message

Binding conflict

The same IP:port:host combination may exist on another site or a blank host header may conflict.

No matching error was found.

Security and operational risks

Do not go to production before these checks

  • Run the first execution with 2 test domains; do not push the complete domain list directly to production.
  • Prepare the domain list as plain domain names without HTTPS, www or paths.
  • Back up panel configuration, DNS zones and web server files before the operation.
  • Never store API keys, root passwords or generated user passwords in the web root.
  • Requesting bulk SSL before DNS propagation completes can cause rate limits and failed validation.
Verification checklist

Criteria for a successful operation

  • Domains appear in the panel or web server listing.
  • Each domain resolves to the correct document root directory.
  • The HTTP request returns the expected status code.
  • DNS A/AAAA records point to the correct server IP address.
  • Failed records are written to a separate log and can be retried.
  • SSL is enabled only for domains that pass DNS validation.
07
Frequently asked questions

Windows Server IIS bulk domain management answers

Is a separate application pool required for every domain?

No. It provides isolation for different customers or applications; low-traffic alias sites within one trust boundary can share a pool.

Can hundreds of bindings be added to one IIS site?

It is technically possible when they serve the same application. Design certificate/SNI, logging, canonical and redirect strategy separately.

How are HTTPS bindings automated?

Obtain and install the certificate in the LocalMachine store, then bind an SNI host binding using its thumbprint. Manage certificate lifecycle separately.

Can PHP sites run on IIS?

Yes, with FastCGI and proper PHP configuration. Standardize PHP handlers, request timeouts and file permissions separately from domain creation.

Can records also be added to Windows DNS Server?

If the DNS role is on the server, cmdlets such as Add-DnsServerResourceRecordA can be used. External DNS or Cloudflare requires a separate provider API workflow.

Can first place on Google be guaranteed?

No. Technical foundations, original copy, multilingual URLs and structured data support visibility but do not guarantee rankings.

08
Topic cluster

Other bulk domain addition guides

09
Primary sources

Official panel, web server and Google documentation

EKA SOFTWARE AND INFORMATION SYSTEMS

Plan your large-scale domain migration without data loss or downtime

We implement panel selection, DNS, SSL, web server, security, backup and verification according to your actual server architecture.

Top