Commands › Exchange Online
New-MapiVirtualDirectory
Create 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
# New-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)
New-MapiVirtualDirectory -WhatIf
New-MapiVirtualDirectory
# 4. Verify and diff
$after = Get-MapiVirtualDirectory
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
New-MapiVirtualDirectory
[-Confirm]
[-DomainController <Fqdn>]
[-ExtendedProtectionFlags <MultiValuedProperty>]
[-ExtendedProtectionSPNList <MultiValuedProperty>]
[-ExtendedProtectionTokenChecking <ExtendedProtectionTokenCheckingMode>]
[-ExternalUrl <Uri>]
[-IISAuthenticationMethods <MultiValuedProperty>]
[-InternalUrl <Uri>]
[-Role <VirtualDirectoryRole>]
[-Server <ServerIdParameter>]
[-WebSiteName <String>]
[-WhatIf]
[<CommonParameters>]
Parameters (12)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.