简体   繁体   中英

Office 365 Email Activity User report using Power Shell Script

I am looking for Email Activity user Details report using power shell script., Which will run through scheduler in weekly basis and create a csv file in my desired location. The report format and data field would be same as the report which I can get through Office 365 Admin portal( Microsoft 365 admin center - Email activity ). How can I get the same report using Power Shell script. I do have user role of "Global Reader"and "Report Reader". Is it sufficient to run PS script to get all the user's email activity report?

For more clarification below is the sample report format: Among those, I am looking for the highlighted column Names:

Report Refresh Date,User Principal Name,Display Name ,Is Deleted,Deleted Date, Last Activity Date,Send Count,Receive Count,Read Count,Meeting Created Count,Meeting Interacted Count ,Assigned Products,Report Period

I tried with this scrip: MailtrafficReport.ps1

But the row count is not the same as the report I am getting manually from Admin portal. Its giving me only few output as well as only 4 columns data. For example: From Admin portal by the manual process I am getting report for time period of 7 days where the number of rows in csv file is around 56k whereas with this upper-mentioned PowerShell script I am getting report with only 6k rows.

Please help me to resolve this.

Who can see reports

People who have the following permissions:

Global admins: We recommend that only a few people in your company have this role. It reduces the risk to your business.

Exchange admins

SharePoint admins

Skype for Business admins

Global reader

Reports reader

Teams Service Administrator

Teams Communications Administrator

Reference: https://docs.microsoft.com/en-us/microsoft-365/admin/activity-reports/activity-reports?view=o365-worldwide

Microsoft puts a limit on the returned data if you are using the portal or PowerShell, I would recommend that you use Microsoft Graph API instead

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM