I was trying to script to list all the open CIFS connections along with the Complete File path that is open to identify the share the user is connected to, then I could filter the share I’m interested in and disconnect all the sessions related to that share.
I couldn’t find a Get command that can give this information, For Ex:
Get-NcCifsSessionFile – gives the file name but not the entire path.
Get-NcCifsSession – gives the ConnectionId but not the path.
I remember you mentioned about doing this completely using Powershell, would you be able to help identify the commands for below:
Get the list of Files (along with their Share Paths) that have an ongoing session along with Connection ID.
Use the Connection ID to kill the session of the user.