How to export by Powerhsell: last activity date in the Office 365 usage reports use

Hi,

In O365 report  I can export:  last activity date in the Office 365 usage reports use

Is possible to do it by PowerShell script?

Thanks
LVL 1
SAM2009Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vasil Michev (MVP)Commented:
Depends on which report exactly you are referring to. In general, all of the new ones are based on data from the Graph and dont have direct PowerShell cmdlets associated with them. You can however write a simple script that gets an access token and fetches the report from the Graph. It's not that complicated, but if you are doing it for the first time you will have to go over some prerequisites, check for example this guide: https://blogs.technet.microsoft.com/cloudlojik/2018/06/29/connecting-to-microsoft-graph-with-a-native-app-using-powershell/

The actual report data is obtained via this Graph query: https://docs.microsoft.com/en-us/graph/api/reportroot-getmailboxusagedetail?view=graph-rest-1.0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SAM2009Author Commented:
So if someone needs to create a script with PowerShell there is no way for now. I would like to extract mailbox activity date for all users....
Vasil Michev (MVP)Commented:
There are ways to get this data via PowerShell, it's simply not as easy as running a single cmdlet, like the ones we had before. At the very least, you will need to register an application and grant the corresponding permissions, as you will need to use that for getting an access token. After you've done that, it takes just few lines of code to request the report and download the CSV File, example here: https://docs.microsoft.com/en-us/graph/api/reportroot-getemailactivityuserdetail?view=graph-rest-1.0
SAM2009Author Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.