Last Modified Script on a Network Directory


We’re looking into solutions to easily manage ex employee user data. We want a PowerShell script to scan our user directory (\server\userhomedirs), look for the last modified date (last time folder had changes), tell us if no changes have occurred in over a year, and email us that report if no changes occurred. We only care about the main directory and it doesn’t need to include sub folders. We would also like to include folder size in GBs if possible. Thoughts? Thanks!


Not sure crawling part of the directory structure would produce the results you want. If you has something as simple as this:

  • userhomedir
    • ---ssampson
      • ------mystuff
        • --------christmasideas.txt

If the user was updating their Christmas ideas, only the file and the folder above would show changed. Most user directories can be many layers deep. You would have to gather the entire file\folder structure to have accuracy. If the user is no longer at the company, why would someone be actively working in that users’s folder? It could be moved to an Archive directory and deleted after a year.