question

ashisharya65 avatar image
0 Votes"
ashisharya65 asked Crystal-MSFT commented

Need to get Intune Device's Enrolledby user's ID via Powershell with Graph

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

mem-intune-graph
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Crystal-MSFT avatar image
0 Votes"
Crystal-MSFT answered Crystal-MSFT commented

@ashisharya65, I have done a test in my lab. Set the Primary user with a different user with Enrolled By.
88052-image.png

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.
87930-image.png
88015-image.png
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.



image.png (66.0 KiB)
image.png (317.3 KiB)
image.png (76.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ashisharya65, Hope things are going well. If there's anything else we can help, feel free to let us know.

1 Vote 1 ·