Hello,
Unfortunately, as of my knowledge cutoff in September 2021, Microsoft 365 Defender Threat Analytics does not provide a specific API or PowerShell command to retrieve the overall counts of Ransomware, Phishing, and Vulnerability incidents for the entire tenant. At that time, Threat Analytics mainly focused on providing insights and visualizations through its web-based portal.
However, Microsoft frequently updates and enhances its services, so it's possible that new features or APIs have been introduced since then. To get the most accurate and up-to-date information on retrieving such counts programmatically, I recommend referring to the official Microsoft documentation for Microsoft 365 Defender, checking the Microsoft Graph API documentation, or reaching out to Microsoft Support for assistance. They can provide you with the latest information and guidance on accessing the required data programmatically.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
--If the reply is helpful, please Upvote and Accept as answer--