PowerShell Lab
Build, find and save PowerShell
Reviewed templates and commands with requirements, permissions and risk spelled out. Nothing here runs anything — you copy, review and run it yourself.
Search pages, tools, PowerShell commands and ports
List and close open SMB files on a file server.
1Get-SmbOpenFile | Where-Object Path -like '*Budget2026.xlsx*' |2 Select-Object ClientComputerName, ClientUserName, Path, FileId3 4# Close it (the user loses unsaved changes):5# Get-SmbOpenFile | Where-Object Path -like '*Budget2026.xlsx*' | Close-SmbOpenFile -Force