Link to home
Start Free TrialLog in
Avatar of sid20vt
sid20vt

asked on

Find files owned by specific users in a shared directory/sub directories

Hi All,

I'm trying to get a list of files owned by specific users in a network share on server 2008 R2.
Tried icacls <path> /findsid <username> but this is incorrect.

How can I do this and output the results to a file?
is there a command or powershell method for this?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of sid20vt
sid20vt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chrismerritt
chrismerritt

Was going to say, something like this would work in PowerShell as well, you could filter the results as appropriate:

$NetworkSharePath = "X:\Technical\"

$Files = gci $NetworkSharePath -recurse | ? {$_.PsIsContainer -eq $False}
foreach ($File in $Files)
{
	Write-Host "Processing File: $($File.FullName)"
	$File | Add-Member -MemberType "NoteProperty" -Name "Owner" -Value (($File | Get-Acl).Owner.ToString())
}

$Files | Select FullName, Owner

Open in new window