HI Team,
May I know how can we leverage Graph using Powershell to extract the Enrolledby user name's object ID for Intune machines.
Regards,
Ashish Arya
HI Team,
May I know how can we leverage Graph using Powershell to extract the Enrolledby user name's object ID for Intune machines.
Regards,
Ashish Arya
@ashisharya65, I have done a test in my lab. Set the Primary user with a different user with Enrolled By. 
Then import Intune module and connect to Microsoft Graph with the following command:
Import-Module Microsoft.Graph.Intune #import intune module
Update-MSGraphEnvironment -SchemaVersion beta #set schema version as beta
Connect-MSGraph #connect to MS grasp
After that, run the following command to get the testing device information:
Get-IntuneManagedDevice -managedDeviceId <Intune Device ID>
After checking the device information, I find the value of the "Enrolled by" is the same as userdisplayname. And the userid is the id of this user.

So for your question, I think we can refer to the "userid" property of the device.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@ashisharya65, Hope things are going well. If there's anything else we can help, feel free to let us know.
5 people are following this question.