How can I get user's sent, received and read count for a specific date range?

%3CLINGO-SUB%20id%3D%22lingo-sub-1133270%22%20slang%3D%22en-US%22%3EHow%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1133270%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20O365%2C%20in%20the%20%22E-mail%20activity%22%20reports%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fadmin.microsoft.com%2FAdminportal%2FHome%23%2FreportsUsage%2FEmailActivity%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fadmin.microsoft.com%2FAdminportal%2FHome%23%2FreportsUsage%2FEmailActivity%3C%2FA%3E%2C%20there's%20a%20dashboard%20that%20presents%20data%20for%20e-mail%20accounts.%20Some%20columns%20are%20Received%20count%2C%20sent%20count%20and%20read%20count.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20only%20limited%20to%20choosing%20%22Last%207%20days%22%20or%2030%20days%20or%2090%20days.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20get%20this%20data%20for%20a%20specified%20date%20range%3F%20For%20example%2C%201%2F1%2F2020%20through%201%2F28%2F2020%3F%26nbsp%3B%3C%2FP%3E%3CP%3EClosest%20solution%20I%20can%20think%20of%20is%20starting%20a%20Get-MessageTrace%20on%20the%20first%20day%20of%20the%20date%20range%20and%20saving%20it%20as%20a%20.csv%20for%20each%20day%2C%20or%20appending%20it%20and%20add%20a%20date%20column%20for%20the%20date%20the%20cmdlet%20was%20run.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1133270%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1133339%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1133339%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20answered%20on%20EE%2C%20y%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3Eou%20can%20either%20get%20it%20for%20a%20specific%20duration%20(7%2C30%2C%20etc%20days)%20or%20specific%20date%20(not%20a%20range).%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Freportroot-getemailactivityuserdetail%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Freportroot-getemailactivityuserdetail%3Fview%3Dgraph-rest-1.0%26amp%3Btabs%3Dhttp%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1143980%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1143980%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOh%20hi!%20lol.%20Thanks%20so%20much.%20Yes%20that%20helps.%20Coming%20across%20this%2C%20it%20looks%20like%20that's%20exactly%20what%20I%20need%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgsexdev.blogspot.com%2F2018%2F01%2Fa-walk-though-using-graph-api-mailbox.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgsexdev.blogspot.com%2F2018%2F01%2Fa-walk-though-using-graph-api-mailbox.html%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1145107%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1145107%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInterestingly%2C%20after%20I%20figured%20out%20how%20to%20return%20data%20for%20a%20particular%20date%2C%20I%20show%20for%20my%20own%20e-mail%20that%20I%20didn't%20send%20or%20receive%20or%20read%20any%20e-mail%20on%20Jan%2015th.%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20when%20I%20look%20at%20my%20Outlook%20client%2C%20I%20see%20plenty%20of%20sent%2Freceived%20e-mail.%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20know%20why%20that%20might%20be%3F%20Is%20that%20data%20only%20for%20a%20certain%20client%20maybe%3F%20Wondering%20if%20maybe%20I%20was%20using%20a%20different%20Outlook%20client%20on%20that%20day.%26nbsp%3B%3C%2FP%3E%3CP%3E%22%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Freports%2FgetEmailActivityUserDetail(date%3D2020-01-15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Freports%2FgetEmailActivityUserDetail(date%3D2020-01-15%3C%2FA%3E)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1145608%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1145608%22%20slang%3D%22en-US%22%3E%3CP%3EWell%20that's%20what%20I%20said%20above%2C%20you%20can%20either%20run%20it%20for%20*specific*%20date%20or%20one%20of%20the%20pre-configured%20ranges%20(1d%2C7d%2C30d%2C..).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1145618%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1145618%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYeah%20that%20definitely%20helped%20and%20works.%20However%20I'm%20finding%20the%20data%20returned%20(number%20of%20e-mails%20sent%20for%20example)%20for%20a%20specific%20date%20is%20different%20than%20what%20I%20see%20at%20my%20mailbox%20level%20for%20the%20same%20date.%26nbsp%3B%3C%2FP%3E%3CP%3EWhich%20makes%20me%20wonder%20if%20the%20last%207%20days%20or%2030%20days%20even%20is%20actually%20returning%20accurate%20data.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20say%20you%20ran%20the%20query%20I%20did%2C%20and%20saw%20your%20mailbox%20in%20the%20report%20for%20that%20specific%20date.%20And%20it%20said%20your%20number%20of%20emails%20sent%20was%208.%20Then%20you%20went%20to%20your%20Outlook%20and%20looked%20at%20your%20sent%20items%2C%20and%20you%20counted%2020%20sent%20with%20that%20same%20date.%20Would%20it%20seem%20like%20the%20Graph%20API%20was%20off%20a%20bit%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1146911%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1146911%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20wont%20be%20the%20first%20time%20those%20reports%20are%20inaccurate%2C%20or%20missing%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1146962%22%20slang%3D%22en-US%22%3ERe%3A%20How%20can%20I%20get%20user's%20sent%2C%20received%20and%20read%20count%20for%20a%20specific%20date%20range%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1146962%22%20slang%3D%22en-US%22%3EThanks%20yeah%20it%20just%20seems%20like%20a%20casual%20collection%20of%20data%20not%20to%20be%20depended%20on%20for%20business.%3CBR%20%2F%3EI%20think%20I%E2%80%99m%20better%20off%20going%20on%20the%20Exchange%20server%20to%20get%20Sent%20and%20Received%20counts%20perhaps.%20Won%E2%80%99t%20give%20me%20%E2%80%9Cread%E2%80%9D%20but%20I%20think%20that%E2%80%99s%20unimportant.%3C%2FLINGO-BODY%3E
Contributor

In O365, in the "E-mail activity" reports at https://admin.microsoft.com/Adminportal/Home#/reportsUsage/EmailActivity, there's a dashboard that presents data for e-mail accounts. Some columns are Received count, sent count and read count.  

This is only limited to choosing "Last 7 days" or 30 days or 90 days.   

Is there a way to get this data for a specified date range? For example, 1/1/2020 through 1/28/2020? 

Closest solution I can think of is starting a Get-MessageTrace on the first day of the date range and saving it as a .csv for each day, or appending it and add a date column for the date the cmdlet was run. 

7 Replies

As answered on EE, you can either get it for a specific duration (7,30, etc days) or specific date (not a range). https://docs.microsoft.com/en-us/graph/api/reportroot-getemailactivityuserdetail?view=graph-rest-1.0...

@Vasil Michev 

Oh hi! lol. Thanks so much. Yes that helps. Coming across this, it looks like that's exactly what I need:

https://gsexdev.blogspot.com/2018/01/a-walk-though-using-graph-api-mailbox.html

 

Thank you

@Vasil Michev 

Interestingly, after I figured out how to return data for a particular date, I show for my own e-mail that I didn't send or receive or read any e-mail on Jan 15th. 

However when I look at my Outlook client, I see plenty of sent/received e-mail. 

Do you know why that might be? Is that data only for a certain client maybe? Wondering if maybe I was using a different Outlook client on that day. 

"https://graph.microsoft.com/v1.0/reports/getEmailActivityUserDetail(date=2020-01-15)

Well that's what I said above, you can either run it for *specific* date or one of the pre-configured ranges (1d,7d,30d,..).

@Vasil Michev 

Yeah that definitely helped and works. However I'm finding the data returned (number of e-mails sent for example) for a specific date is different than what I see at my mailbox level for the same date. 

Which makes me wonder if the last 7 days or 30 days even is actually returning accurate data. 

 

So say you ran the query I did, and saw your mailbox in the report for that specific date. And it said your number of emails sent was 8. Then you went to your Outlook and looked at your sent items, and you counted 20 sent with that same date. Would it seem like the Graph API was off a bit? 

It wont be the first time those reports are inaccurate, or missing data.

Thanks yeah it just seems like a casual collection of data not to be depended on for business.
I think I’m better off going on the Exchange server to get Sent and Received counts perhaps. Won’t give me “read” but I think that’s unimportant.