Share via

Need script to find who opened company server folders by date

Ahmad Ibrahim 20 Reputation points
2026-06-02T02:51:47.1466667+00:00

I'm asked to check the user activity on our main file machine (ServerX). I need to find out exactly which workers opened the group folders between a specific start day and end day. I do not know how to code this from zero. Does anyone have a PowerShell code that can search the audit logs and show me this information? Please share it if you can. Thank you so much!

Windows for business | Windows 365 Enterprise
0 comments No comments

Answer accepted by question author

Jason Nguyen Tran 18,980 Reputation points Independent Advisor
2026-06-02T03:42:28.6233333+00:00

Hello Ahmad Ibrahim,

To track which users opened folders on your company server, you’ll need to rely on Windows auditing logs rather than trying to code everything from scratch. The good news is that PowerShell can query these logs once auditing is enabled on the folders.

First, make sure auditing is turned on for the shared folders in question (right‑click the folder > Properties > Security > Advanced > Auditing). Once auditing is active, you can use PowerShell’s Get-WinEvent command to filter the Security log by Event ID 4663, which records file and folder access. For example:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4663; StartTime='05/25/2026'; EndTime='05/28/2026'} | Select-Object TimeCreated, @{Name='User';Expression={$_.Properties[1].Value}}, @{Name='Object';Expression={$_.Properties[6].Value}}

This script will show the time, user, and folder accessed between the dates you specify. You can adjust the StartTime and EndTime values to match your reporting window.

I hope the response provided some helpful insight. If you find this answer useful, please hit “accept answer” so I know it addressed your concern.

Jason.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.