Mar 07, 2019 Getting the last-logon-date/time of O365 user is a vital task to track the user’s last logon activity, find Inactive users and remove their licenses. The last-logon-time shows the time a user last accessed their mailbox using Outlook, WebMail, or their mobile phone. Export Office 365 User Last Logon Time Using PowerShell.
Good Morning, Experts! Firstly, I will be the first to admit: I am a PowerShell amateur. What we are wanting to do is setup a script that will: - Audit all Active Directory Users, to see when their last logon was (lastlogon) - Export this information to a .csv file labeled lastlogon-audit-<yyyymmdd> - Include the following LDAP fields, each in its own column: Login Name, Display Name, Email Address, Description, Account Disabled, Last Logon - If possible, highlight users who have not logged in for more than 7 days - Email that report to a specific email address We have a similar setup for Password Expiration, though that script is more sophisticated, in that it emails the users whose passwords will expire in 14 days, and outlines password rules. That script predates my time here.
Let say I have 2 users, so that I need to check the last logon time.
Then the LastLogonTime property return NULL. So I know this user never login to mailbox.
So I using the same command for user no 2
Then powershell show warnings like this :
The user hasn't logged on to mailbox 'User No 2' ('1cf70e56-6580-479b-993f-bc0b46fb23sd'), so there is no data to return. After the user logs on, this warning will no longer appear
So my boss asked, what the different for this user. I believed both of users never login the to Exchange but why only one user return warnings?
How do I can explain to them?
Azri ZakariaAzri Zakaria
1 Answer
The second mailbox probably hasnt received an email, where as the first email box has. Can you confirm this?
The second error message supposedly happens when there is no emails in the box, where as the first error message happens when there is some form of data or mail in the box
colbytcolbyt
Not the answer you're looking for? Browse other questions tagged powershellexchange-2010 or ask your own question.