get-childitem on lastwritetime remote computer RRS feed

  • Question

  • I am trying to find the most recent written files/folders on a C drive on multiple machines. but its very slow and I am not even sure its working

    $servers = get-content "c:\scripts\servers.txt"

    foreach ($server in $servers){

    invoke-command -computername $server {get-childitem c:\ -recurse | sort lastwritetime}


    any help appreciated

    • Moved by Bill_Stewart Wednesday, September 4, 2019 7:15 PM Help vampire
    Friday, March 22, 2019 2:28 PM

All replies

  • This will take a very long time no matter how you do it.  It will also not give any useful results as the OS is constantly writing to hundreds of files.

    You need to narrow you request.  Pick a folder or a set of folders.  Use aa workflow to search all systems in parallel.


    Friday, March 22, 2019 3:04 PM