Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Brian33

macrumors 65816
Original poster
Apr 30, 2008
1,480
375
USA (Virginia)
How can I get the number of SMB (local file sharing) users currently connected to a Mac, using Terminal.app commands or a script?

The only place I can find this number is in SystemPreferences->Sharing, then select File Sharing, then click the 'Options...' button. (See image below, from Monterey.) Is this number viewable or get-able in any other way on any version of macOS?

I'm having various SMB issues with Finder and with Time Machine that I'm trying to troubleshoot. I've looked at man pages for smbutil, smbd, nsmb.conf, and mount_smbfs...

Number of users connected.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.