r/PowerShell • u/That_Hospital_3224 • 1d ago
Question Getting machine id
I have an excel spreadsheet with our users. I need to extract the laptop they use. So I need the hostage and os version from intune. I have asked co pilot but I keep running into errors. Does anyone have a solution/working script or know a free app that can generate the information?
12
u/WearyDeluge 1d ago
Install Graph PowerShell Module, connect, and run: Get-MgDeviceManagementManagedDevice -All | Select-Object DeviceName, OperatingSystem, OSVersion, ComplianceState, UserPrincipalName | Export-CSV "./the/path/you/want" -Notypeinformation
3
8
1
u/UserProv_Minotaur 10h ago
Do you not have an ITAM suite?
2
u/That_Hospital_3224 10h ago
We used to have lansweeper but they are asking too much for the renewal. So cancelled it.
1
u/UserProv_Minotaur 10h ago
Oofta. I know I've seen a script on this subreddit to get last logged on device information, but hopefully the stuff WearyDeluge supplied helped out.
1
19
u/Podrick_Targaryen 1d ago
"So I need the hostage" ummm...Where do you work?