Forum Discussion
MsGraph CloudPC and lastLoginResult
Hello, I am trying to find a way to audit Microsoft 365 Cloud PC usage. I think it would be very useful to retreive the lastLoginResult object from our CloudPC's for this, but I am not able to. Within the module 'Microsoft.Graph.Beta.DeviceManagement.Administration' there is a function 'Get-MgBetaDeviceManagementVirtualEndpointCloudPc' which should get this data back, but instead of the date it retrieves the value 'Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphCloudPcLoginResult'.
So when I run:
Get-MgBetaDeviceManagementVirtualEndpointCloudPc | select-object id,imageDisplayName,lastModifiedDateTime,lastRemoteActionResult,lastLoginResult
it returns:
Id : 33333b4a-fb9e-4c18-89a3-29e0d7fb6666
ImageDisplayName : Windows 11 Enterprise + Microsoft 365 Apps 21H2
LastModifiedDateTime : 11/4/2023 12:11:28 PM
LastRemoteActionResult : Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphCloudPcRemoteActionResult
LastLoginResult : Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphCloudPcLoginResult
Is anyone able to explain how to read this, why does it return 'Microsoft.Graph.Beta.PowerShell.Models.MicrosoftGraphCloudPcLoginResult' instead of the date I would expect it to return. Or better, what can I do to get the lastLoginResult returning the actual date someone last loggedon to the device.
Thanks in advance