Commands › Exchange Online

Set-MapiVirtualDirectory

Exchange Online ExchangeOnlineManagement Set-*

Modify Messaging Application Programming Interface (MAPI) virtual directories that are used in Internet Information Services (IIS) on Microsoft Exchange servers. A MAPI virtual directory is used by supported versions of Microsoft Outlook to connect to mailboxes by using the MAPIHTTP protocol.

Quick start script

# Set-MapiVirtualDirectory — 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-MapiVirtualDirectory
$before | Format-List

# 3. Make the change (dry run first)
Set-MapiVirtualDirectory -Identity <VirtualDirectoryIdParameter> -WhatIf
Set-MapiVirtualDirectory -Identity <VirtualDirectoryIdParameter>

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

Syntax

Set-MapiVirtualDirectory [-Identity] <VirtualDirectoryIdParameter>
 [-ApplyDefaults <Boolean>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-ExtendedProtectionFlags <MultiValuedProperty>]
 [-ExtendedProtectionSPNList <MultiValuedProperty>]
 [-ExtendedProtectionTokenChecking <ExtendedProtectionTokenCheckingMode>]
 [-ExternalUrl <Uri>]
 [-IISAuthenticationMethods <MultiValuedProperty>]
 [-InternalUrl <Uri>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (11)

ParameterTypeRequiredWhat it controls
-Identity VirtualDirectoryIdParameter yes The Identity parameter specifies the MAPI virtual directory that you want to modify. You can use any value that uniquely identifies the virtual directory. For example:
-ApplyDefaults Boolean The ApplyDefaults switch specifies whether to apply the correct defaults to the related internal IIS application settings. Typically, this switch is used only by Exchange Setup during the installation of Exchange...
-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.
-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.
-IISAuthenticationMethods MultiValuedProperty The IISAuthenticationMethods parameter specifies the authentication methods that are enabled on the virtual directory in Internet Information Services (IIS). Valid values are:
-InternalUrl Uri The InternalURL parameter specifies the URL that connects to the virtual directory from inside the firewall.
-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.

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