foreach($file in get-smbopenfile | ? {$_.Path -like "*.tar" -and -not ($_.ClientUserName -like "JABIL\SV*")}) { $m = Get-Item $file.Path | Where{$_.CreationTime -lt (Get-Date).AddMinutes(-1)} | measure $m.Count if($m.Count -eq 1) {close-smbopenfile -SessionId $file.SessionId -Confirm:$false} }
PowerShell命令关闭长时间被占用的共享文件
猜你喜欢
转载自www.cnblogs.com/dream1699/p/11240325.html
今日推荐
周排行