Calendar settings

This code sample retrieves the following calenar settings of an Exchange mailbox:

  • Calendar attendant status
  • Remove meeting forward notifications
  • Remove old meeting requests and responses
  • Mark new meeting requests as Tentative
  • Process meeting requests and responses originating outside the Exchange organization

In the below code sample, the $mailboxParams variable represents properties of an Exchange mailbox. To retrieve the properties, use the IAdmExchangeMailParametersOps::GetMailParameters method.

 How
[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=domain,DC=com"
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)

# Get Exchange properties
$mailboxParams = $user.GetMailParameters()
# The $mailboxParams variable represents properties of an Exchange mailbox

# Get 'Calendar Settings'
$calendarSettings = $mailboxParams.CalendarSettings

# Calendar attendant status
$calendarAttendant = $calendarSettings.AutomateProcessing
Write-Host "Calendar Attendant is " -NoNewline
switch ($calendarAttendant)
{
    "ADM_EXCHANGE_AUTOMATECALENDARPROCESSINGTYPE_NONE" 
    {
        Write-Host "Disabled"
    }
    "ADM_EXCHANGE_AUTOMATECALENDARPROCESSINGTYPE_AUTOUPDATE"
    {
        Write-Host "Enabled"
    }
    "ADM_EXCHANGE_AUTOMATECALENDARPROCESSINGTYPE_AUTOACCEPT"
    {
        Write-Host "Enabled"
    }
}

# Remove meeting forward notifications
Write-Host "`tRemove meeting forward notifications to the Deleted Items folder:" `
    $calendarSettings.RemoveForwardedMeetingNotifications
    
# Remove old meeting requests and responses
Write-Host "`tRemove old meeting requests and responses:" $calendarSettings.RemoveOldMeetingMessages

# Mark new meeting requests as Tentative
Write-Host "`tMark new meeting requests as Tentative:" $calendarSettings.AddNewRequestsTentatively

# Process meeting requests and responses originating outside the Exchange organization
Write-Host "`tProcess meeting requests and responses originating outside the Exchange organization:" `
    $calendarSettings.ProcessExternalMeetingMessages

See also