How to find what Apple ID is logged in to the managed iPad.

Gotti
New Contributor II

All user are login with manager Apple ID but some haver manage to log out and download there own apps, I have added a restriction policy which stops this happening.

But I would like to find out who is currently logged in with their own Apple IDs.

Is there any way of doing this on jamfcloud?

 

 

10 REPLIES 10

Andreas_Schenk
Contributor
Contributor

An MDM Server like Jamf can not see the Name of the logged in Apple ID. This is a decision from Apple in their great wisdom. We can like it or not, but it is what it is. You might want to file Feedback with Apple, to grant MDM Servers the capability to do so. (Probably not likely to be changed, as Apple considers the Name of the Apple ID to be private).

MDM Servers can only query a hash of the logged in Apple ID. But not the clear text Name.

Gotti
New Contributor II

@Andreas_Schenk Thank you so much for the reply. 

techjason
Contributor

@Gotti I have been looking for something like this for a long-time myself. But @Andreas_Schenk  is right; there is no way, right now, of getting this information. However, if you are interested in doing it on a Mac, there is a solution. I have been using this extension attribute for over a year in our environment.

https://github.com/bp88/Jamf-Pro-Extension-Attributes/blob/master/iCloud%20Account%20Details.sh

Maybe someday we will be able to get that info.

 

jmahlman
Valued Contributor

@Gotti  We have an EA that does this for us:

#!/bin/sh
## Get logged in user
loggedInUser=$(stat -f%Su /dev/console)
icloudaccount=$( defaults read /Users/$loggedInUser/Library/Preferences/MobileMeAccounts.plist Accounts | grep AccountID | cut -d '"' -f 2)
if [ -z "$icloudaccount" ] 
then
    echo "<result>No Accounts Signed In</result>"
else
    echo "<result>$icloudaccount</result>"
fi

 

Off topic, why is bash/shell not a code option in JN?!  

Screen Shot 2021-11-11 at 3.10.11 PM.png

sdrake
New Contributor III

This works perfectly, thank you!!

MarcozEspitia
New Contributor

Hello Guys,

Both Scripts that you guys provided don't work. It doesn't find any Macbooks that have AppleID on them. Knowing for a fact that at least 10 of them have it. Any more suggestions?

The EA script that @jmahlman posted, does work in my setting (for macOS; original post asked for iOS).

You might want to look at the parts of that script and its results. What is the result if you run it on those computers as an Extension Attribute and what is the result if you run it on your admin computer?

entrata
New Contributor II

Do you put this script into a smart group? If so what is the criteria you use to search for the computers in question?

vickih
New Contributor III

Personally I added the script as an extension attribute and then it populates in the inventory section of the computer in the section I wanted. This will run on its own during an inventory check-in.  If anyone finds a mobile device (iPad) solution please update this thread. Since everyone is posting about Desktop instead of iPad. :D Extension Attribute.png

DLR
New Contributor

Man and iPad solution would be so nice! if anyone knows of one please let me know!