Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At work there's a network and everyone has a username and password that they use to log in. How can I search for my files on this network?

I could list all the files like this:

cd \\192.168.*.***\f:\
dir -Recurse -Force
share|improve this question

2 Answers 2

dir is the old way for DOS / Windows, Powershell gives you get-childItem

You should identify the directory you want to look for your files on, and then do something like:

$myDir = "\\Server\Directory\"

get-ChildItem -Path $myDor | Foreach {
 get-Acl $_
}
share|improve this answer
    
Thanks! After editing the first line to the proper directory I just run it in powershell and it should work? –  elisha May 9 '13 at 17:32
    
That is a start at least. Once you run that you will get the root objects and go from there. There is not recursion which you can easily add, and you would need to check the ACLs for your AD account as owner (hopefully). –  AthomSfere May 9 '13 at 17:34
    
"and you would need to check the ACLs for your AD account as owner (hopefully). –" What do you mean? I'm not that techy :) –  elisha May 9 '13 at 18:46

You can filter the files that are owned by you by using the following code

Get-ChildItem \\server\share -Recurse | Where-Object { 

    ($_ | Get-ACL).Owner -match $env:USERNAME 
}

The Get-ACL cmdlet gets the ACL and ownership for the folder/file and compares it to the $env:USERNAME variable which is the current username you are logged on to.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.