Jon.Black
macadmin

Mac Admin: Grabbing AnyDesk identifiers and storing them in Mosyle.

Jon Black 1 min read
Mac Admin: Grabbing AnyDesk identifiers and storing them in Mosyle.
Photo by Sigmund / Unsplash

Rather than going into AnyDesk and manually grabbing a users device identifier, we can just grab it direct from the system.conf file on a users device and throw it into Mosyle as a variable that can be looked up.

Here's the code:

if [ ! -e "/private/etc/anydesk_ad_uniqueIDHere/system.conf" ]; then
    echo ""
else
    grep -E 'ad.anynet.alias' "/private/etc/anydesk_ad_uniqueIDHere/system.conf" | awk -F"ad.anynet.alias=" '{print $2}'
fi

Do a quick look to see what the unique code is for your Anydesk instance by installing it on your device first, doing an ls on the directory (so, ls /private/etc/), then replacing "uniqueIDHere" in the script with the instance code. It'll be obvious when you see it.


Here's what mine looks like:

And here's the result once it runs:


I set it to execute on every mac startup and "Device Info" update.

Share
More from Jon.Black

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Jon.Black.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.