Forum Discussion
How to Automate Windows 365 Cloud PC Last Login monitoring!
JJGuirola This article has certainly given me the best chance at getting some sort of Cloud PC usage reporting to our managers. Where it fails for me is in the capturing of the lastLoginResult value and I can't do anything without that date/time value.
In the Apply to Each loop, I can see that it captures data for all Cloud PCs by using each ID value .. and that value changes for every iteration of the loop so I know it's working there. Yet when it reaches the 2nd JSON parsing, this is an example of what I get. When it then reaches the Condition it believes the lastLoginResult value is NULL and it follows the No path. Yet as you can see from the image there is a value.
So that got me to thinking the Condition was wrong. For the evaluation value I am using what appears to me to be the right value. I included a screen shot of that too.
Any ideas or items from my flow you'd like to see?
Thanks
Rob
I was able to resolve this by generating a new JSON schema. The one posted in the article may be outdated. Specifically, the schema for lastLoginResult changed.
{
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"id": {
"type": "string"
},
"displayName": {
"type": "string"
},
"imageDisplayName": {
"type": "string"
},
"status": {
"type": "string"
},
"userPrincipalName": {
"type": "string"
},
"lastModifiedDateTime": {
"type": "string"
},
"managedDeviceName": {
"type": "string"
},
"lastRemoteActionResult": {
"type": "object",
"properties": {
"actionName": {
"type": "string"
},
"actionState": {
"type": "string"
},
"startDateTime": {
"type": "string"
},
"lastUpdatedDateTime": {
"type": "string"
},
"cloudPcId": {
"type": "string"
},
"managedDeviceId": {},
"statusDetail": {},
"statusDetails": {
"type": "object",
"properties": {
"code": {},
"message": {},
"additionalInformation": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
]
}
}
}
}
}
},
"lastLoginResult": {
"type": "object",
"properties": {
"time": {
"type": "string"
}
}
}
}
}