Exchange powershell command for total emails?

Daisyahoy 1 Reputation point
2022-05-19T18:08:20.703+00:00

Hi,

I'm looking for a powershell command or alternate way to see all users and total emails sent per user per month?

Thank you for any help!

Exchange Exchange Server Management
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kael Yao 37,746 Reputation points Moderator
    2022-05-20T05:52:54.707+00:00

    Hi @Daisyahoy

    Please kindly note that our forum doesn't support scripting.
    If you need suggestions on your script, please consider posing in Windows Server Powershell forum or Exchange Development forum.
    (You can add the corresponding tags windows-server-powershell and office-exchange-server-dev to your question to post in these forums)


    Are you using Exchange On-premises or Exchange Online (Office 365)?

    For Exchange On-premises, here is a script which may be helpful.
    You can download it via this link: https://web.archive.org/web/20200324061458/https://gallery.technet.microsoft.com/scriptcenter/Count-sent-and-recceived-f9c66cf7

    To use the script to generate a report and send to a specific mailbox, you may need to modify the following fields (modify to to be your mailbox and SmtpServer to be your Exchange server name) and run the script via Exchange Management Shell:

    ############ Send emails with results  
    send-mailmessage -to "******@domain.com" -from "StatMails@exchange" -subject "Stats mails From $StartDate To $EndDate" -body ($body | out-string) -BodyAsHTML -SmtpServer "xxx.xxx.xxx.xxx:YY"  
    

    For Exchange Online, you can use the built-in Email activity report feature in Microsoft 365 admin center.
    Direct link: https://admin.microsoft.com/Adminportal/Home?#/reportsUsage/EmailActivity
    It would generate a detailed report of the email activity in your tenant.
    Example:
    203947-38.png

    If you would like to display the user names instead of showing anonymous user names, please follow the steps in this link:
    Microsoft 365 reports show anonymous user names instead of actual user names


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.