Hello Tom Wrigglesworth,
Greetings! Welcome to Microsoft Q&A Platform.
I understand that you would like to know about the open files in file share by a particular user. You can list open files on an Azure File Share using the PowerShell command Get-AzStorageFileHandle
. This command allows you to list file handles of a file share, a file directory, or a specific file. Here’s a basic example of how you can use it:
# Connect to your Azure account
Connect-AzAccount
# Get the storage account context
$context = (Get-AzStorageAccount -ResourceGroupName "YourResourceGroupName" -Name "YourStorageAccountName").Context
# List open file handles in the file share
Get-AzStorageFileHandle -Context $context -ShareName "YourFileShareName" -Recursive
You can use the PowerShell command
Using Windows tools: Handles.exe You can use Handle.exe on a Windows client to check if there are open handles on the client against the Azure File.
Example: handle <StorageAccountName>.file.core.windows.net
The script can however be worked further to list open handles and close a single handle etc.
For more details: https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles.
Similar ask thread for reference - https://learn.microsoft.com/en-us/answers/questions/1047102/azure-files-open-files.
Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.