Jump to content

Script to find who has a file open on a network share


Recommended Posts

Posted

I have looked and can't find this anywhere...

 

Has anyone got a script they can send me that allows you to check who has a certain file open on a network share ?

Important updates have been made on one of the documents by HR/Finance but somebody has it open and for the life of me can't find who

Posted
May be a stupid reply but have you tried looking in the 'Shares and Storage Management' on the server holding the shares.

 

I was thinking along similar lines - can you not use computer management --> Shared Folders -->

 

Either under sessions or open files should show you who has what open and you can right click on the relevant items and click disconnect

 

Not sure if its the same now on a Server OS ?

  • Thanks 1
Posted
@mac_shinobi @jmcdermott Thanks guys, yes I have tried this but on the open files it said nobody had the file open so that's why I thought possibly there may have been a script to see if there was anything that wasn't getting picked up on the Computer Management
Posted (edited)

This should find it from the commandline

 

openfiles.exe /query /s

 

Then followup with the /op paramater if needed to clear the lock

 

Openfiles

Edited by Mayki5
Posted

Not related to the OP but tried running a command prompt as administrator ( right click --> run as admin ) and also shift and right click to run as another user using a domain admin account and I get this message :

C:\windows\system32>openfiles /local

 

INFO: The system global flag 'maintain objects list' is currently disabled.

Posted
openfiles /local are local file handles by the local machine and users, and by default machines don't audit them. You can switch it on running "openfiles /local on" or just try running openfiles without the /local switch. See here for further details Openfiles
  • Thanks 1
Posted

Hi Guys thanks for your help.

The issue is resolved now, we have a dual OS running through Vmware fusion and a staff member had the documents open on Windows but then put the windows OS to sleep and continued to work on the secondary OS

 

Thanks for all your help !!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...