Error while opening address book. Error Code: 0x00040380 (MAPI_W_ERRORS_RETURNED)

Error while opening address book. Error Code: 0x00040380 (MAPI_W_ERRORS_RETURNED)

If you get the following error in the Application Event log:

The AgendaX Update Service reported the following error:
General Error - Output: Error while opening address book.
Error Code: 0x00040380 (MAPI_W_ERRORS_RETURNED)
Description: The connection to Microsoft Exchange is unavailable. Outlook must be online or connected to complete this action.
MAPI was unable to load the information service EMSMDB.DLL. Be sure the service is correctly installed and configured..

and you are connecting to Office 365, please follow the steps below to solve this problem:

Add the following keys to the registry, logged-in with the user that is used to run the AgendaX Update Service:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Identity

EnableADAL (DWORD) 1
DisableAADWAM (DWORD) 1
DisableADALatopWAMOverride (DWORD) 1

16.0 is for Outlook 2016, 2019 and Outlook 365. If you use Outlook 2013, you have to update to Outlook 2016 or above as Microsoft does not support connections to O365 with earlier clients anymore.

Go to Control Panel / Credentials Manager / Windows Credentials and delete all credentials starting with MicrosoftOffice16_Data.

Reboot the server (not always necessary), recreate the Outlook profile that you have configured AgendaX to use, turn off Exchange Cache Mode in the profile, start Outlook with this profile, close Outlook again.

If you are prompted for username / password, please activate the checkbox 'Save password'.

After these steps, the error logged to the Application eventlog should go away.


What are the system requirements for AgendaX?

AgendaX needs the following components:

  • Microsoft Windows Server (all versions are supported)
  • Microsoft IIS Server
  • 32bit Outlook Client installed on the AgendaX Server
  • A SQL Server or SQL Server Express

Even though AgendaX can be installed on the same server like Exchange Server, we recommend to install AgendaX on an existing IIS Server with a minimum of 2 GB of RAM and a Dual-Core-CPU.

Supported Versions of Exchange are:

  • Microsoft Exchange Server (5.5, 2000, 2003, 2007, 2010, 2013, 2016, 2019, Office 365 / Hosted Exchange)

We are moving to Office 365 (gradually). What needs to be done to an existing installation of AgendaX V6.x?

If the move to Office 365 takes some time and you migrate mailboxes with several batches, we suggest to install a second instance of AgendaX during the transition.

The first (existing) instance will read on-premise mailboxes and the second (new) instance will read migrated (O365) mailboxes.

During the transition, you will still see all calendars of both on-premise and migrated mailboxes in the AgendaX web application.

 

Installing a second AgendaX Setup on the AgendaX server to access the O365 mailboxes

  • Create a new AgendaX user on Office 365 (including mailbox)
  • Copy the AgendaX installation folder to a second location, e.g. AgendaXO365
  • Install the second service with the Multi service configuration tool AgendaX multi service configuration utility. The service account you enter will be the account used to run the AgendaX Update Service. This should ideally be the new AgendaX user on Office 365. If this is not possible, select a local user with Administrative privileges on the AgendaX Server.
  • Install Outlook 2016 (or later) on the AgendaX Server, if not already present
  • Log on with the new AgendaX user (or the local user you specified while installing the second service) to the AgendaX server
  • Set the appropriate registry flags for the Outlook version used and AgentX.ini settings (pages 5/6 in the Installation Guide: AgendaX Installation Guide)
  • Create an Outlook profile with this user, accessing its mailbox on O365, and disabling Exchange Cache Mode in the Outlook profile. If you are prompted for a username / password, check the ‘Remember Password’ option before entering the credentials. Note the name of the Outlook profile you created (default: Outlook)
  • Run the AgendaX Configuration in the AgendaX O365 installation (AgendaXCfg.exe), click MSX Version, select Office 365 and enter the name of the Outlook profile you created, logged-in with the O365 AgendaX user (or the local user).
  • Set the Mailbox folder permissions for the users already migrated to O365 with the following, language-independent Powershell script. You will have to initiate a remote Powershell session first with O365, using the Get-Credential, New-PSSession and Import-PSSession commands. Replace “agendax” on the 3rd line in the following script with the name of your O365 AgendaX account:
    Connect-ExchangeOnline
    foreach ($Mailbox in (Get-EXOMailbox -OrganizationalUnit abc -ResultSize Unlimited))
    {
    Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
    Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
    }
    Disconnect-ExchangeOnline
    
    "-OrganizationalUnit abc" limits the users to a specific OU (here "abc"). This can be omitted if you would like
    to grant the permissions on every account in your organization.
    
    If, instead, you would like to limit the users to users that have a specific SMTP- address, you can use the
    following script:
    
    Connect-ExchangeOnline
    foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited | where-Object {($_.PrimarySMTPAddress -like "*@agendax.net")}))
    {
    Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
    Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
    }
    Disconnect-ExchangeOnline
    
    Or, if you would like to limit the users to members of a specific distribution list, you can use the following:
    
    Connect-ExchangeOnline
    foreach ($Mailbox in (Get-DistributionGroupMember -Identity "NameOfDistributionList" -ResultSize Unlimited))
    {
    Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
    Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
    }
    Disconnect-ExchangeOnline
  • Stop the AgendaX Update service of the old AgendaX installation
  • Run the AgendaX Configuration of both the old and the new installation (AgendaXCfg.exe) and tick the “Multiple services write to this database” option and drop the database tables (only once) under Config / Drop tables.
  • Click “Update” in both AgendaX Configuations and “Yes” to restart the Services
  • Check the Windows Application Eventlog for possible warnings / errors. Each of the services will add warnings to the Application Event log for the mailboxes that are not on their system. This is normal. The on-premise Setup will create warnings for the O365 mailboxes and the O365 Setup will create warnings for the on-premise mailboxes. If you get warnings on the O365 installation about mailboxes that cannot be found in the global address book and these mailboxes have already been migrated to O365, you will have to re-select them from the address book in the AgendaX group definitions (AgendaXCfg.exe / Groups).
  • After both AgendaX Update Services have finished scanning through the mailboxes, you will see both on-premise and O365 mailbox calendars in the AgendaX web application.
  • While you are moving users from the on-premise Exchange servers to O365, you will need to re-run the above Powershell script to set permissions on the newly moved mailboxes.

 

Removing the old AgendaX Setup after all mailboxes are moved to O365

When all mailboxes are moved to O365, you can uninstall the old AgendaX setup by following the below steps. As the web-application of AgendaX is still running under your old AgendaX setup, you will first need to move this to the location of the new (O365) installation:

  • Run Internet Information Services (IIS) Manager, navigate to Sites / Default Web Site / AgendaX, click “Basic settings” and change the location of the “Physical path” to the folder of your new AgendaX O365 installation.

If you have made any configuration changes on the AgendaX Administration page (in the AgendaX web application) since you installed the O365 installation of AgendaX, or if you have made changes to the collapsible group menu in the multmenu.txt file, copy config.inc and multmenu.txt (both are located in the AGENDA subfolder of your AgendaX installation folder) from the old Setup to the O365 setup.

 

To uninstall the old AgendaX Setup, follow the steps below:

  • Stop the AgendaX Update Service of the old installation
  • Close any instances of MMC (Microsoft Management Console), e.g. Services, Event Viewer
  • Open a command prompt and change to the AgendaX installation folder of your old AgendaX installation, e.g. CD C:\Inetpub\AgendaX
  • Enter the following command:
    AgendaXSrv.exe -u (this will uninstall the AgendaX Update Service)
  • Delete the old AgendaX installation folder

The final step is to tell the AgendaX Update service that no longer other services are using the same database. Run the AgendaX Configuration (AgendaXCfg.exe) in your new O365 setup folder and untick the “Multiple services write to this database” option and drop the database tables under Config / Drop tables, then click “Update” and “Yes” to restart the service.


Language independent permission settings for AgendaX on Exchange Server 2013, 2016, 2019, Office 365

Permissions that need to be set for the AgendaX account on Exchange Server 2013, 2016, 2019, and Office 365 are Outlook folder level permissions.

Since folder names in Outlook differ depending on the language used when the mailbox is first opened with Outlook, you'd have to know which employee uses which language to assign permissions to the correct folders. In addition to that, you'd have to know what the folders are called in these languages.

If you have mailboxes in multiple languages in your company, you can easily set the required permissions for the AgendaX account using the following script, which works for all languages.

Please make sure you replace "agendax" on the 3rd line with the name of your AgendaX account:

Connect-ExchangeOnline
foreach ($Mailbox in (Get-EXOMailbox -OrganizationalUnit abc -ResultSize Unlimited))
{
Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
}
Disconnect-ExchangeOnline

"-OrganizationalUnit abc" limits the users to a specific OU (here "abc"). This can be omitted if you would like
to grant the permissions on every account in your organization.

If, instead, you would like to limit the users to users that have a specific SMTP- address, you can use the
following script:

Connect-ExchangeOnline
foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited | where-Object {($_.PrimarySMTPAddress -like "*@agendax.net")}))
{
Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
}
Disconnect-ExchangeOnline

Or, if you would like to limit the users to members of a specific distribution list, you can use the following:

Connect-ExchangeOnline
foreach ($Mailbox in (Get-DistributionGroupMember -Identity "NameOfDistributionList" -ResultSize Unlimited))
{
Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
}
Disconnect-ExchangeOnline

Just copy and paste the above script into Powershell. It will assign Reviewer rights on the top of the mailbox and Inbox, as well as Editor rights on the Calendar folder.

If you don't want to assign these rights on every mailbox in your organization, but would rather limit this to an organizational unit for example, you can modify the Get-Mailbox statement on the 1st line by adding -OrganizationalUnit with the name of the organizational unit you wish to assign permissions in.


How does AgendaX behave in an Exchange cluster server environment?

Since AgendaX behaves like an Outlook client, nothing special needs to be considered in a cluster server environment. If a cluster member server goes down, AgendaX automatically connects to another member server as soon as it takes over.


Do I need to install AgendaX directly on the Exchange server?

No, AgendaX can be installed on any IIS server. An installation on Exchange Server is not required. Also, no components need to be installed on the Exchange server.


Hosted Exchange Environments

AgendaX works installed on a server of your Exchange provider, or installed on your local network. Most probably, your Exchange Hosting provider will not let you install anything on his servers. In this case, you can install AgendaX on your local network. On the AgendaX Server computer, install Outlook 2013 or later instead of the MAPI download. Then, create a mailbox (e.g. 'AgendaX'), and give this mailbox the following permissions on every mailbox that you want to read and publish with AgendaX:

  • Rewiewer rights on the top of the mailbox (in some Outlook versions called 'Outlook Today') and on the Inbox
  • Editor rights on the Calendar folder

The following EMS scripts (or similar) might be helpful for doing this for all or a subset of mailboxes:

Connect-ExchangeOnline
foreach ($Mailbox in (Get-EXOMailbox -OrganizationalUnit abc -ResultSize Unlimited))
{
Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
}
Disconnect-ExchangeOnline

"-OrganizationalUnit abc" limits the users to a specific OU (here "abc"). This can be omitted if you would like
to grant the permissions on every account in your organization.

If, instead, you would like to limit the users to users that have a specific SMTP- address, you can use the
following script:

Connect-ExchangeOnline
foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited | where-Object {($_.PrimarySMTPAddress -like "*@agendax.net")}))
{
Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
}
Disconnect-ExchangeOnline

Or, if you would like to limit the users to members of a specific distribution list, you can use the following:

Connect-ExchangeOnline
foreach ($Mailbox in (Get-DistributionGroupMember -Identity "NameOfDistributionList" -ResultSize Unlimited))
{
Add-MailboxFolderPermission -identity "$($Mailbox.Name)" -AccessRights Reviewer -User agendax
Add-MailboxFolderPermission -identity "$($Mailbox.Name):\Calendar" -AccessRights Editor -User agendax
}
Disconnect-ExchangeOnline

Create a user account ('AgendaX') in your local Active Directory and log in with that account on the AgendaX server. Start Outlook and create a profile that accesses the mailbox of the AgendaX user. Finally, install AgendaX and when prompted for the Exchange Server version, check the checkbox labeled 'Exchange is hosted by a hosting provider in an untrusted domain' and enter the name of the profile you created above.


Installing AgendaX in a Subnet and WNLB

If AgendaX is installed on a subnet of your Exchange Server Active Directory, AgendaX might have difficulty to connect to the Exchange Servers. You might also not be able to ping the CAS array on Exchange 2010+, while pinging individual mailbox servers works fine. In this case, it could be that you are using Windows Network Load Balancer (WNLB) and you will need to statically assign the ARP entry in your router. More on this topic can be found here: http://social.technet.microsoft.com/Forums/da-DK/exchangesvravailabilityandisasterrecovery/thread/175551e6-d241-42d0-b8ab-d4d435554923


Protocols / Ports used by AgendaX

AgendaX uses MAPI or Outlook MAPI to connect to the Exchange Servers. MAPI is a standard Microsoft protocol that uses RPC or HTTP connections to / from the Exchange Servers. When using Outlook MAPI, the RPC / MAPI packets may be encapsulated in HTTP packets.

AgendaX uses standard TCP/IP connections to access SQL servers / SQL Server Express.


Can I scan calendars of multiple Exchange server versions?

Yes, AgendaX can scan mailbox calendars of any Exchange Server version with a single AgendaX Update Service. Make sure that you setup the AgendaX Service account mailbox on the Exchange server with the latest version, and specify that Exchange server version during Setup / in AgendaXCfg.exe. Also, make sure to define all Exchange Servers in the 'Servers' configuration of AgendaXCfg.exe


Page 1 of 212

Contributions related to the subject

Would you like to write a guest post?
Please contact us.