Repository navigation
What's new
dbo.usp_ReadMailbox_EWS-- a new SQLCLR proc reading an on-premises Exchange mailbox via EWS (Exchange Web Services), Windows/NTLM auth + Exchange Impersonation. Lives alongside the existing Graph-basedusp_ReadMailboxin the same assembly.EwsToSqlSync-- a standalone alternative to the EWS proc: a plain .exe you run on a schedule via Windows Task Scheduler, using the same EWS logic but writing to SQL Server with an ordinary login instead of SQL Server CLR. No assembly registration, no trust hashes. Includes MessageId-keyed dedupe so repeat scheduled runs don't insert duplicate rows.Deploy-EWS.sql,Deploy-Full-Remote.sql(fully self-contained deploy with the DLL bytes embedded as a hex literal, so there's no separate .dll file needed on the target server), andDrop-And-Recreate.sql(clean re-deploy when a stale assembly is registered).- README.md documents both approaches side by side with a comparison table, plus setup steps for each.
Attached binaries
MailboxReaderClr.dll-- built from this tag, net472, contains bothMailReader(Graph) andEwsMailReader(EWS)EwsToSqlSync.exe-- the standalone scheduled-task alternative (needsconfig.jsonalongside it, seeEwsToSqlSync/config.example.json)
Both are provided for convenience; building from source (dotnet build -c Release) remains fully supported and gives you full control over what SQL Server or Task Scheduler ends up trusting/running.
Known limitation
The EWS-based code (both the SQLCLR proc and EwsToSqlSync) has not yet been verified against a live on-premises Exchange server. Treat the exact SOAP request/response shape as a strong first draft to validate against your own Exchange version/CU, per the Troubleshooting sections in README.md.