I'm trying to research file access and ownership to solve some issues on our file share server, could anyone point me to a good ITPro video covering such topics in detail please. Many thanks.
-
File security & ownership
-
Hey @it-admin,
Many of our Windows 10 and Server 2016 episodes cover share and NTFS permissions. Can you be more specific on what you are trying to do?
Here is a PowerShell script that will list file info, including owner and last access time, for a directory, and export the info to a csv file.
$arr = @() gci C:\scripts -recurse | ? {$_.PSIsContainer -eq $False} | % { $obj = New-Object PSObject $obj | Add-Member NoteProperty Directory $_.DirectoryName $obj | Add-Member NoteProperty Name $_.Name $obj | Add-Member NoteProperty Length $_.Length $obj | Add-Member NoteProperty Owner ((Get-ACL $_.FullName).Owner) $obj | Add-Member NoteProperty Access $_.LastAccessTime $obj | Add-Member NoteProperty Extension $_.Extension $arr += $obj } $arr | Export-CSV -notypeinformation "report.csv"
Let me know if this is what you are looking for.