A SharePoint web application is the IIS website that hosts your site collections in SharePoint Server. Create one in Central Administration (Application Management > Manage web applications > New) or run New-SPWebApplication in an elevated Windows PowerShell 5.1 window:
$ap = New-SPAuthenticationProvider
New-SPWebApplication -Name "SPGuides Intranet" `
-ApplicationPool "SharePoint - Intranet" `
-ApplicationPoolAccount (Get-SPManagedAccount "SPGUIDES\sp-webapp") `
-Url "https://intranet.spguides.com" -Port 443 -SecureSocketsLayer `
-AuthenticationProvider $ap
SharePoint builds the IIS site and app pool on every web server, creates the content database and returns the new web application.
In this tutorial, we’ll create a SharePoint web application both ways in SharePoint Server Subscription Edition, then extend it to a second zone, set alternate access mappings and delete it safely.
What is a SharePoint web application?
It’s the top container for content in a farm: an IIS website with its own URL, an application pool and one or more content databases. Our SharePoint Server Subscription Edition guide shows where it fits.
Its authentication, zones and policies apply to every site collection inside it. Central Administration has its own web application, so users need at least one more. A farm supports 20.
Does SharePoint Online have web applications?
No. In Microsoft 365, Microsoft runs the farm. The closest equivalent is a site, which you create in the SharePoint admin center or with New-PnPSite in PnP PowerShell.
Before you start
Build on Subscription Edition. SharePoint Server 2016 and 2019 left extended support on July 14, 2026, and Windows Classic authentication isn’t supported in Subscription Edition. Check the hardware and software requirements first.
- Central Administration: membership in the Farm Administrators group.
- PowerShell: securityadmin on SQL Server, db_owner on the databases and local Administrators (plus Add-SPShellAdmin).
- A managed account for the app pool (New-SPManagedAccount), a DNS record and an SSL certificate.
Create a web application in Central Administration
These screenshots come from an older farm; Subscription Edition adds a Use Server Name Indication option and certificate selection.
Open Central Administration, select Application Management, then Manage web applications:

In the Contribute group of the ribbon, select New:

In IIS Web Site, choose Create a new IIS web site, enter a name, port 443 and the host header. Under Security Configuration, keep Allow Anonymous at No and set Use Secure Sockets Layer (SSL) to Yes:

In Claims Authentication Types, keep Enable Windows Authentication and pick Negotiate (Kerberos), which Microsoft recommends. Add forms-based or a trusted identity provider only if you need them:

Keep the default sign-in page and type the Public URL (zone Default). Under Application Pool, create a new pool and pick your managed account. Then enter the database server and a readable database name, and keep Windows authentication:

Keep the default Service Application Connections group, or pick [custom], then select OK:

New-SPWebApplication syntax and parameters
Only -Name and -ApplicationPool are required. In Subscription Edition the cmdlets load automatically, so skip Add-PSSnapin, but they don’t run in PowerShell 7. Our SharePoint tutorials hub covers more admin scripts.
-Url is the public URL and -HostHeader the internal one. -ApplicationPoolAccount is needed only for a new pool, and -DatabaseName defaults to WSS_Content_<GUID>. Skip -AuthenticationMethod: it means classic mode.
Create an HTTPS web application with PowerShell
This script mirrors the Central Administration page, including SNI:
$ap = New-SPAuthenticationProvider # Windows claims (Kerberos or NTLM)
New-SPWebApplication -Name "SPGuides Intranet" `
-Url "https://intranet.spguides.com" `
-HostHeader "intranet.spguides.com" `
-Port 443 -SecureSocketsLayer -UseServerNameIndication `
-ApplicationPool "SharePoint - Intranet" `
-ApplicationPoolAccount (Get-SPManagedAccount "SPGUIDES\sp-webapp") `
-AuthenticationProvider $ap `
-DatabaseServer "SQL01" `
-DatabaseName "WSS_Content_Intranet"
In Subscription Edition, assign the certificate in SharePoint certificate management, not IIS. Then create the root site collection:
New-SPSite "https://intranet.spguides.com" -OwnerAlias "SPGUIDES\megan.bowen" `
-Name "SPGuides Intranet" -Language 1033 -Template STS#0
If provisioning stalls, the error details are in the SharePoint ULS logs.
Extend a web application to another zone
Extending gives the same content a second URL and IIS site, often with different authentication for partners. The five zones are Default, Intranet, Internet, Extranet and Custom.
In Central Administration, select the web application and choose Extend. In PowerShell:
Get-SPWebApplication "https://intranet.spguides.com" |
New-SPWebApplicationExtension -Name "SPGuides Extranet" -Zone "Extranet" `
-Url "https://extranet.spguides.com" -HostHeader "extranet.spguides.com" `
-Port 443 -SecureSocketsLayer
Configure alternate access mappings
Alternate access mappings tell SharePoint which public URL to put in links when requests arrive on an internal URL, such as behind a reverse proxy. They’re under System Settings > Configure alternate access mappings:
# Public URL
New-SPAlternateURL "https://portal.spguides.com" -WebApplication "https://intranet.spguides.com" -Zone "Internet"
# Internal URL
New-SPAlternateURL "https://sp-internal.spguides.com" -WebApplication "https://intranet.spguides.com" -Zone "Internet" -Internal
Microsoft marks alternate access mapping as deprecated and recommends host-named site collections for new designs.
Delete a SharePoint web application
In Manage web applications, select it and choose Delete, or use PowerShell:
# Remove one zone only
Remove-SPWebApplication "https://intranet.spguides.com" -Zone "Extranet" -DeleteIISSite -Confirm
# Remove everything
Remove-SPWebApplication "https://intranet.spguides.com" -DeleteIISSite -RemoveContentDatabases -Confirm
-RemoveContentDatabases deletes the databases permanently, so back them up. Online, you’d delete a SharePoint Online site with PowerShell instead.
More SharePoint admin guides you may need next:
Frequently Asked Questions
How many web applications can a SharePoint farm have?
Microsoft supports 20 per farm and recommends as few as possible.
Do I need Add-PSSnapin for New-SPWebApplication?
Not in Subscription Edition. SharePoint Server 2016 and 2019 still need it outside the SharePoint Management Shell.
Can I manage web applications in SharePoint Online?
No. SharePoint in Microsoft 365 has none; you manage sites in the SharePoint admin center.
Which authentication should a new web application use?
Windows claims with Kerberos, and keep Windows authentication on one zone so search can crawl. See Create claims-based web applications.

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.
Question: in a minrole multiserver environment where do you run this script? on the CA host machine or on one of the WFE devices ?