I’ve been wanting an excuse to try developing a GUI in power shell for a while so decided to put together this front end which will check the Office 365 last logon date and time for all users and quickly enable you to see which Office 365 Accounts are inactive.
Office 365 Inactive account report script
When you run the script you will be presented with this form:
- Enter your Office 365 username and Password and click “Login”.
- Wait while the script connects to your Office 365 server and downloads your mailbox information:
- Review all of your inactive accounts!
You can sort the list by the last logon date and time or the number of days since last logon by clicking on the column headers.
If the user has never logged in they have their last logon date set to 01/01/2000. This script makes things a little easier than getting too deeply involved in Powershell to discover this useful information.
Srinivas says
Hello ,
When I am running this script, my Powershell blinks for a moment and then disappears.. Please let me know that wrong am I doing in this.
Regards,
Srinivas.K
Paulie says
I’m not sure why, but I would like to find out. Would you be prepared to do a remote control session with me so I can help you figure it out?
Andrew says
The script will not execute because it is not digitally signed.
Right click on the file, select properties, then click the Unblock button at the bottom. It will work fine after that.
pawan ashish says
Is there a way I can get user who has logged in to a particular site in SharePoint online. In our organisation we are not using office 365 mailbox.
Paul T. Ireland says
This is a great script. I only wish you included a way to export the information it finds to a CSV, Excel file, or Web Page.
Paulie says
It would be pretty easy to add that functionality in. I’m having a boring night in, so maybe I will do it for you!
Paulie says
Download it again now, an Export to CSV option has been added, which appears when the logon information has been downloaded. Best of luck.
clint says
Great script! Thanks so much for sharing. We are in the process of rolling out Office 365 and this is a great way to see who hasn’t read our “must sign in email” to test credentials.
clint says
Okay, dumb question. Where does it export to? I assumed the same directory as the script was in but I’m not seeing it. From looking at the code, I don’t see an export path so was thinking it would be in the same directory.
Paulie says
Glad it’s useful.
P Warren says
I downloaded your zip file, but now what? When I open the ps1 file, it just opens a text file with a bunch of stuff I don’t know what to do with. When I call it from a ps window, I only get “>>” in response.
Paulie says
A powershell file is just a text file with stuff in it! It seems that you have also tried to run it from Powershell, but you probably need to edit your Powershell execution policy to make it work. Have a look at:
https://technet.microsoft.com/en-us/library/ee176961.aspx
See how you get on. It should be easy once you have got the script running.
David Carter says
Hi Paul,
Very nice script. Is there a way you can add the display name to the output csv file? it would be very nice to the first and last name of the accounts that never have logged in as well as the email address. Thanks!
Dave
David C Carter says
I love this script. I ran it but cant find the csv file after I exported it. Can you tell me where it is?
fran says
Very nice, thanks!
David C Carter says
Where is the output file? I cant seem to dind the CSV file anywhere.
Thanks
LA says
The output file is in the same folder as the PowerShell script file.
Bala Krishna says
Good script.
If tenant has more than 10000+ users, it takes long time. Is it possible to give input file either .txt or .csv format which contains , only 2000 or 3000 users in the input file. This helps to reduce no.of sessions connecting to Powershell or fix throttling issues.
Regards
Bala
Paulie says
Wow, I’ve never used a tenant with that many users. I’m sure an input filter is possible, have you tried to modify the code?
Asif says
Can we have a script that works for any user irrespective of licenses?
Jason Joomaye says
Hi
It seems that this script is no longer available. If it is as good as all the comments suggests then I would like to try it out. Do you still have the script….?
Paulie says
Thanks for letting me know! I will try and dig it out – I’m sure I have it somewhere and I’m pretty sure it was decent! Let you tomorrow.
Paulie says
Hey – I found the script, tested it and it still works. Try the download link again and you should have more luck.