I am crossing my fingers that someone out there has run across this problem and can point me in the right direction. I read a bit about the Get-OpenSMBFiles cmdlet and wish that i could use it, but from what i can tell it is only available on Windows Server 2012 and above and our file server is running on Windows Server 2008 R2. However, if you read down the link where i found the second script people start talking about how "the script is closing them, but as they are still open on the destination client the session reopens as the resource is still being used." I can confirm this as I ran the script and checked through Computer Management -> Shared Folders -> Open Files and saw the files were closed, then upon a refresh in the Open Files window, the files would reopen automatically.Īm I correct in thinking that this is because the files are still open on the client side they auto-connect after the cmds/scripts are done running? This script: from here for /f "skip=4 tokens=1" %a in ('net files ^| findstr C:\Apps\') do net files %a /closeįrom here $results = net file | Select-String -SimpleMatch "D:\Sap_Labels\" I have done some googling and found the following fixes: Let us know if there is a way to close the opened files. I am looking for a way to run a batch script to close all open files from our file server. We have to restart the SFTP server every time we get this issue. Hello r/sysadmin - i am hoping you can help me.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |