getting info about mounted smb volume

Hi…

I’m trying to get information about an already-mounted smb volume – specifically, I’m interested in finding the username that mounted to volume. (It may not be the same as the local MacOSX username.) I won’t go into the details of why I need this information, unless it turns out to be relevant or important.

The Finder information window for the mounted volume has a ‘Server’ field, which I could maybe parse to get the username. But it would be nice if it were available as a discrete value. I’ve looked around but come up empty-handed.

Thanks for any pointers!

It seems to me that the following should work.


tell application "Finder"
	owner of disk "YourMountedDiskName"
end tell

At least here, it shows the user who mounted it! (10.4.9) Also, I assume you mean “current” rather than “local” when you’re referring to the username, correct?

Hi…

Thanks for the idea. My test indicates that the “owner of disk “YourMountedDiskName”” line tells the local username that mounted the volume rather than the username who authenticated to the network.

To clarify, here’s a sketch of the situation: local username A is logged onto the Mac and mounts an SMB share (via Go->Connect To Server…), authenticating to the network with username B and password. Once the share is mounted, I’m looking for a way to see that username B is the authenticated network user. (I’m not particularly looking for the local username A who mounted the volume.)

Thanks again!

Ah, you didn’t say you wanted the “authenticated” user. :wink: I’m not very certain that this information’s easily obtained. I’m almost certain that you can’t get it from the Finder. Perhaps it’s stored someplace on the file system.

But, I’ll gladly look the next time I mount an SMB share, if no one else has the answer by then. (I’ll probably need a share in 2“3 hours or so, so the wait won’t be that bad. :wink: )