Skip to content

Calendar settings

The following code sample modifies Calendar Settings of a mailbox.

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

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

# Bind to the user
$userDN = "CN=John Smith,CN=Users,DC=example,DC=com"
$user = $admService.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