Posted on 12-12-2013 02:57 AM
Hi,
Does anyone know of the best way to collect which network shares users are connected to in inventory. Would help us to know who actually connects to some of our shares and which protocol they are using.
Im guessing an extension attribute is the way to go but not sure what.
Thanks
Posted on 12-12-2013 03:18 AM
AM playing with df -h but need to get the actual path, it knows it as it is shown when you do a "get info" window on the mounted share.
Posted on 12-12-2013 04:36 AM
The mount command in terminal can show mounted volumes and connection type (smb or afp). You'd have to do a little grep/awk to put it in the format you want though..
Posted on 12-12-2013 04:56 AM
Thanks, will look at that, on 10.9 only (which is fine for this task) the new command "smbutil stashares -a" does the job in terminal but im struggling to get that into an extension atrtrbute.
Posted on 12-12-2013 06:27 AM
+1 mount
(maverick) HPESetc 49 7:25am% mount |awk '/smbfs/{print $1}'
//nessts@hpdev.local/WIP
not sure what you want in the output if you want just the server name or who is mounting etc.
Posted on 12-12-2013 07:59 AM
Thanks, we'd want server name and share definately, but ideally also username and smb_version so Im thinking smbutil does that nicely but either way is good if it works, running "mount |awk '/smbfs/{print $1}'" in terminal lists full path but not much else and agan cant quite get it into an EA.
Posted on 12-12-2013 08:11 AM
echo "<result>print $1</result>"
fi
Posted on 12-13-2013 11:43 AM
i would think your EA should look more like
#!/bin/sh
echo"<result>mount |awk '/smbfs/{print $1}'</result>"
Posted on 12-19-2013 07:46 AM
cheers, still no joy.