Monday 17 September 2018

How do I determine logon/logoff times in Windows Powershell without admin rights?


In order to determine logon and logoff times for a given day on my Windows PC, I've used the following script in Windows PowerShell run as administrator:


Get-WinEvent -FilterHashtable @{starttime='5/6/2018';endtime='5/7/2018';logname='security';id=4648,4634}

I've tried and determined that the above does not work when PowerShell is not run as administrator. Local admin privilege will soon be taken away on the PC on which I need to run this script - which I think means I will no longer be able to run PowerShell as administrator. Is there an alternative that I can run from Powershell or the standard CLI by which I can determine logon and logoff times for a given day?


If relevant, the PC is running Windows 7 Enterprise.



Answer



You could create a scheduled task which is activated whenever one of the relevant events occurs, and writes the desired event info to a log file which is accessible to your non-admin user.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...