Calendar settings

The following code sample modifies Calendar Settings of a mailbox.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Connect to the Adaxes service
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")

# Bind to the user
$userDN = "CN=John Smith,CN=Users,DC=example,DC=com"
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)

# Create an instance of the 'AdmExchangeMailboxParameters' class
$mailboxParams = New-Object "Softerra.Adaxes.Adsi.Exchange.AdmExchangeMailboxParameters"

$calendarSettings = $mailboxParams.CalendarSettings

# Enable the Calendar Attendant
$calendarSettings.AutomateProcessing = "ADM_EXCHANGE_AUTOMATECALENDARPROCESSINGTYPE_AUTOUPDATE"

# Remove meeting forward notifications to the Deleted Items folder
$calendarSettings.RemoveForwardedMeetingNotifications = $true

# Remove old meeting requests and responses
$calendarSettings.RemoveOldMeetingMessages = $true

# Mark new meeting requests as Tentative
$calendarSettings.AddNewRequestsTentatively = $true

# Process meeting requests and responses originating outside the Exchange organization
$calendarSettings.ProcessExternalMeetingMessages = $true
$mailboxParams.CalendarSettings = $calendarSettings

# Save changes
$user.SetMailParameters($mailboxParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_NONE")

See also