Excel 读取文件夹上次修改日期的powershell脚本
我需要一个脚本,读取文件的最后修改日期,由谁修改并输出到excel。我发现了一个脚本,可以更改修改日期Excel 读取文件夹上次修改日期的powershell脚本,excel,date,Excel,Date,我需要一个脚本,读取文件的最后修改日期,由谁修改并输出到excel。我发现了一个脚本,可以更改修改日期 $a = get-date $b = Get-ChildItem "C:\Intel" -recurse | ? { !$_.psiscontainer } foreach ($i in $b) { $i.LastWriteTime = $a } $b 通过检查文件的LastWriteTime属性,可以轻松获取LastWriteTime get-childitem * | sel
$a = get-date
$b = Get-ChildItem "C:\Intel" -recurse | ? { !$_.psiscontainer }
foreach ($i in $b)
{
$i.LastWriteTime = $a
}
$b
通过检查文件的LastWriteTime属性,可以轻松获取LastWriteTime
get-childitem * | select FullName,LastWriteTime,Owner
您可以检查文件的所有者,该所有者可能是也可能不是最后一个要修改的人,具体取决于文件类型。一些办公室文件会将所有者更改为最后一个给他们写信的人,但我不知道这是否可靠
get-childitem * | ForEach-Object {get-acl $_ | select owner}
NTFS不会记录最后一个修改文件的人。您可以打开审核并检查系统审核事件日志,也可以查看filesystemwatcher类并生成监视文件夹更改的自定义脚本。(警告:这可能会导致性能问题。)