How to Update Database Record for User PrimaryAddress (SMTP)
Overview
In some cases a user who has Hosted Exchange provisioned may not be showing in the portal. This issue can occur if there is no PrimaryAddress assigned. This article will show how to assign the PrimaryAddress to get the user to appear in the portal.
important
Create a backup of the OLM database before making any changes.
Retrieve the samAccountName of the Affected User from Active Directory

Review the Information in Database
- Login to your SQL server and execute the below SQL query in SQL Server Management Studio using the samAccountName as the u.[Name]:
use olm
select ue.EmailId, u.[Name], ue.Alias, cd.CustomerDomain, ue.PrimaryAddress
from Users u
inner join UserEmail ue on ue.UserID = u.UserID
inner join CustomerDomain cd on cd.CustDomainID = ue.CustDomainID
where u.[Name] = 'testuser1_EC'
- Look at the result of the query. At least one email address should be set to value
1
in thePrimaryAddress
column:

Review the Primary SMTP address of the User in Active Directory
- Review the user's AD attribute
proxyAddresses
for email address configurations.

info
You might need to enable Advanced Features within Active Directory.
- Take note of the entry that starts with capitalized
SMTP:
because this is the one that will be assigned as Primary Address in the database.

Update the PrimaryAddress in the Database
- To update the
PrimaryAddress
to 1 in the database, run the following command, specifying theEmailId
of the AD attribute that is equal to the entry in the database:

update UserEmail
set PrimaryAddress = 1
where EmailId = 1360
Review the Changes in the Database
- Re-run the previous query:
use olm
select ue.EmailId, u.[Name], ue.Alias, cd.CustomerDomain, ue.PrimaryAddress
from Users u
inner join UserEmail ue on ue.UserID = u.UserID
inner join CustomerDomain cd on cd.CustDomainID = ue.CustDomainID
where u.[Name] = 'testuser1_EC'

- The result now shows
1
as the value on thePrimaryAddress
. Once one of the addresses is set to1
, the user account should now show up in the portal.