
Show HN: Ews-scan – EWS calls in a .NET binary and their Graph equivalents
ews-scan finds the EWS Managed API calls in compiled .NET code and tells you what each EWS operation turns into in Microsoft Graph.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
ews-scan finds the EWS Managed API calls in compiled .NET code and tells you what each EWS operation turns into in Microsoft Graph.
Microsoft is retiring Exchange Web Services in Exchange Online. Before you plan the move for an application built on Microsoft.Exchange.WebServices, you need to know how much of that API it uses. ews-scan reads it from the binaries, so it works even when whoever wrote the application is long gone.
dotnet tool install --global Sunsetless.EwsScan ews-scan C:\path\to\the\application
Point it at a folder of compiled assemblies (a bin folder, or wherever the application is installed) or at a single .dll or .exe. Subfolders are included. You need the .NET 8 runtime or later.
For each assembly that calls the EWS Managed API, the calls are grouped by EWS operation. The operation names are the SOAP actions you see in the EWS usage report in the Microsoft 365 admin center, so the two are easy to compare.
Option What it does
--format text Plain text for the terminal (default).
--format markdown Tables to paste into a ticket or a pull request.
--format json The same data as JSON, for scripts.
--output <file> Writes the report to a file.
--callers Shows which methods each call is made from.
How it works
ews-scan reads the metadata and IL of each assembly with System.Reflection.Metadata. It never loads or runs the code and makes no network requests. Because it works on IL, the source language doesn't matter: C#, VB.NET and F# are all fine.
It knows three libraries: Microsoft's Microsoft.Exchange.WebServices, the .NET Standard port Microsoft.Exchange.WebServices.NETStandard, and Sunsetless EWS, which shows up on the Library line as "(Sunsetless EWS)". The assemblies can target anything from .NET Framework 2.0 to 4.8, .NET Standard or .NET.
Calls through reflection or dynamic, and PowerShell scripts that load the library. Neither leaves a call in a compiled assembly.
Enum values that come from a field, a config file or a branch. WellKnownFolderName.PublicFoldersRoot is only found when it's written as a literal in the calling method.
Folders and items opened by a stored ID. A stored public folder ID looks like any other ID.
EWS requests sent as raw SOAP, without the Managed API.
How often a call runs. The report counts call sites in the code, while the EWS usage report in the admin center counts requests.
Load() on a folder is counted under GetItem, because items and folders share that method. If a folder tree has several copies of the same assembly, you only see the newest. obj and ref folders are skipped.
The Graph calls and notes come from Microsoft's EWS to Graph mapping table and from our own tests on Exchange Online, written up in EWS operations in Microsoft Graph. If the Graph line says "not in Microsoft's mapping table", Microsoft doesn't list the operation and we haven't tested a replacement either. Graph keeps changing, so check the calls your code relies on.
We also make Sunsetless EWS, a commercial library: you keep your EWS Managed API code and it sends the calls to Microsoft Graph. The "Sunsetless" line in each entry says whether the library handles that call, and in the Markdown report it links to the compatibility list. If you're rewriting for Graph by hand, skip that line. Nothing else in the report depends on it.
dotnet test dotnet run --project src/EwsScan -- C:\path\to\the\application
Which API members map to which EWS operations is defined in src/EwsScan/catalog.json. If the report puts a call under the wrong operation or misses one, open an issue or send a pull request for that file.
MIT. Sunsetless is independent and not affiliated with, endorsed by or sponsored by Microsoft.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。