PowerShell – Search Files on all available Clients in Active Directory Domain
26. May 2014
0

Sounds strange but I needed to find all specific files on all reachable clients in Active Directory domain, created in the last seven days. This can be done by powershell:

$clients = dsquery computer "ou=clients,dc=intern,dc=cortoso,dc=com" -o rdn
foreach($client in $clients) {
   $client = $client.Replace("`"","")
   Get-ChildItem \\$client\c$\Users –Recurse | where {$_.extension –eq “.id” –and $_.LastWriteTime –gt (Get-Date).AddDays(-7)}
}

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.