Hotspot detection

bbelew
Contributor

Does anyone have a script or a workflow to identify users who are connected to a mobile hotspot instead of a school or corporate network?

Trying to identify and squash the issue that is apparently running rampant in my building.

Thanks!

5 REPLIES 5

gersteina1
New Contributor III

I was recently dealing with something similar - I made an Extension Attribute that looks at what Wifi they are on puts that into the EA:

#!/bin/bash
# /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep 'sSSID:' | sed 's/.*: //'
# http://apple.stackexchange.com/questions/191879/how-to-find-the-currently-connected-network-service-from-the-command-line
#
# Looks to see what wifi they are connected to
# 2016-11-18 gersteina1 v1.0

if [[  -e `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep 'sSSID:' | sed 's/.*: //'` ]]; then
    echo "<result>No</result>"
else
    echo "<result>`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep 'sSSID:' | sed 's/.*: //'`</result>"
fi

I then have a couple of smart groups based on the results of that EA.

azevon
New Contributor II

gersteina1 - so when you use this EA, what do you use for your operator & value settings in criteria? I setup the EA I believe correctly (String, EA, Script and then the script you mentioned above). But not sure what to use for criteria in smart group.

Thanks for pointing me in the right direction!

gersteina1
New Contributor III

I created a new Smart group that looks at the "Connected Wireless" criteria if it's not like our campus one, and not blank, then it goes into the "Wifi: Not connected to <campus ssid>" group.

jillhughes
New Contributor III

So how do you squash it!

sdagley
Esteemed Contributor II

@jillhughes Take a look at this thread: Managing WiFi on macOS