Report on O365 Account Last login

All, could anyone please assist me in how best to create a Powershell script that pulls all licensed and unlicensed accounts from O365, with their last login date?

I am not a Powershell expert and so any help would be appreciated.

Thank you.


Carl, welcome to Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

What kind of help would you expect? Did you try to search for it? I’m pretty sure you’re not the first one with such a kind of task. :wink:

This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.