Commands › Exchange Online

New-WebServicesVirtualDirectory

Exchange Online ExchangeOnlineManagement New-*

Create Exchange Web Services virtual directories that are used in Internet Information Services (IIS) on Microsoft Exchange servers. You can create multiple virtual directories by using this cmdlet. However, you can create only one Exchange Web Services virtual directory for each website.

Quick start script

# New-WebServicesVirtualDirectory — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-WebServicesVirtualDirectory
$before | Format-List

# 3. Make the change (dry run first)
New-WebServicesVirtualDirectory  -WhatIf
New-WebServicesVirtualDirectory

# 4. Verify and diff
$after = Get-WebServicesVirtualDirectory
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

New-WebServicesVirtualDirectory [-ApplicationRoot <String>]
 [-AppPoolId <String>]
 [-AppPoolIdForManagement <String>]
 [-BasicAuthentication <Boolean>]
 [-Confirm]
 [-DigestAuthentication <Boolean>]
 [-DomainController <Fqdn>]
 [-ExtendedProtectionFlags <MultiValuedProperty>]
 [-ExtendedProtectionSPNList <MultiValuedProperty>]
 [-ExtendedProtectionTokenChecking <ExtendedProtectionTokenCheckingMode>]
 [-ExternalUrl <Uri>]
 [-Force]
 [-GzipLevel <GzipLevel>]
 [-InternalNLBBypassUrl <Uri>]
 [-InternalUrl <Uri>]
 [-MRSProxyEnabled <Boolean>]
 [-MRSProxyMaxConnections <Unlimited>]
 [-OAuthAuthentication <Boolean>]
 [-Path <String>]
 [-Role <VirtualDirectoryRole>]
 [-Server <ServerIdParameter>]
 [-WebSiteName <String>]
 [-WhatIf]
 [-WindowsAuthentication <Boolean>]
 [-WSSecurityAuthentication <Boolean>]
 [<CommonParameters>]

Parameters (25)

ParameterTypeRequiredWhat it controls
-ApplicationRoot String The ApplicationRoot parameter specifies the metabase path of the virtual directory. By default, this path is the same as the website in which the virtual directory is created.
-AppPoolId String The AppPoolId parameter specifies the IIS application pool in which the virtual directory runs. We recommend that you leave this parameter at its default setting.
-AppPoolIdForManagement String The AppPoolIdForManagement parameter specifies the pool of programs that manages the virtual directory.
-BasicAuthentication Boolean The BasicAuthentication parameter specifies whether Basic authentication is enabled on the virtual directory. Valid values are:
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DigestAuthentication Boolean The DigestAuthentication parameter specifies whether Digest authentication is enabled on the virtual directory. Valid values are:
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-ExtendedProtectionFlags MultiValuedProperty The ExtendedProtectionFlags parameter specifies custom settings for Extended Protection for Authentication on the virtual directory. Valid values are:
-ExtendedProtectionSPNList MultiValuedProperty The ExtendedProtectionSPNList parameter specifies a list of valid Service Principal Names (SPNs) if you're using Extended Protection for Authentication on the virtual directory. Valid values are:
-ExtendedProtectionTokenChecking ExtendedProtectionTokenCheckingMode The ExtendedProtectionTokenChecking parameter specifies whether Extended Protection for Authentication is used for client connections to the virtual directory. Valid values are:
-ExternalUrl Uri The ExternalURL parameter specifies the URL that connects to the virtual directory from outside the firewall.
-Force SwitchParameter The Force switch hides warning or confirmation messages. You don't need to specify a value with this switch.
-GzipLevel GzipLevel The GzipLevel parameter sets the Gzip configuration for the Exchange Web Services virtual directory. Valid values are:
-InternalNLBBypassUrl Uri The InternalNLBBypassUrl parameter specifies the URL of the Exchange server that has the Client Access server role installed, regardless of whether it's behind a Network Load Balancing (NLB) array or not.
-InternalUrl Uri The InternalURL parameter specifies the URL that connects to the virtual directory from inside the firewall.
-MRSProxyEnabled Boolean The MRSProxyEnabled parameter specifies whether to enable MRSProxy for the Mailbox server. MRSProxy is a service that runs on Mailbox servers in a remote forest and helps to proxy a mailbox move. For more...
-MRSProxyMaxConnections Unlimited The MRSProxyMaxConnections parameter specifies the maximum number of simultaneous move sessions that an instance of MRSProxy accepts. This setting accepts values from 0 to unlimited. The default value is 100. For...
-OAuthAuthentication Boolean The OAuthAuthentication parameter specifies whether OAuth authentication is enabled on the virtual directory. Valid values are:
-Path String The Path parameter sets the path of the virtual directory in the metabase.
-Role VirtualDirectoryRole The Role parameter species the configuration for the virtual directory. Valid values are:
-Server ServerIdParameter The Server parameter specifies the Exchange server that hosts the virtual directory. You can use any value that uniquely identifies the server. For example:
-WebSiteName String The WebSiteName parameter specifies the name of the website under which to create the virtual directory. This parameter shouldn't be used when you're creating a virtual directory under the default website.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.
-WindowsAuthentication Boolean The WindowsAuthentication parameter specifies whether Integrated Windows authentication is enabled on the virtual directory. Valid values are:
-WSSecurityAuthentication Boolean The WSSecurityAuthentication parameter specifies whether WS-Security (Web Services Security) authentication is enabled on the virtual directory. Valid values are:

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.