Commands › Exchange Online
New-SharingPolicy
Create a sharing policy to regulate how users inside your organization can share calendar and contact information with users outside the organization. Users can only share this information after federation is configured in Exchange. After federation is configured, users can send sharing invitations that comply with a sharing policy to external recipients in other Exchange Server 2010 or later organizations that have federation enabled. A sharing policy needs to get assigned to a mailbox to be effective. If a mailbox doesn't have a specific sharing policy assigned, a default policy enforces the
Quick start script
# New-SharingPolicy — 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-SharingPolicy
$before | Format-List
# 3. Make the change (dry run first)
New-SharingPolicy -Name <String> -Domains <MultiValuedProperty> -WhatIf
New-SharingPolicy -Name <String> -Domains <MultiValuedProperty>
# 4. Verify and diff
$after = Get-SharingPolicy
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax
New-SharingPolicy [-Name] <String> -Domains <MultiValuedProperty>
[-Confirm]
[-Default]
[-DomainController <Fqdn>]
[-Enabled <Boolean>]
[-WhatIf]
[<CommonParameters>]
Parameters (7)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.