I am using net use to map shares on a windows machine to Red Hat Linux using Likewise CIFS. I was wondering if there is a way to check which user a particular share was mapped as. I desire this information because Guest Mode is enabled which will mount the share as guest if invalid credentials are received. Therefore I am curios to know if the share got mounted as guest or as a different local user. If possible I would like to do this from the command line so it can be automated in a script.
On the sharing box (in this case, the Windows box), you can find some information from 'net file' and 'net session' though I find the information to be incomplete.
Though this does not answer your question directly, you can use 'smbstatus' to see the status of connections to SMB shares on a *nix/Samba server.