You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this code, it really helped me know where to look for this data.
I found that the signinlog query that get's repeated for each CloudPC user can be moved outside the loop with this command:
$logons = Get-MgAuditLogSignIn -Filter "startswith(devicedetail/displayname, 'CPC-') and appdisplayname eq 'Windows Sign In' and createdDateTime gt $string"
This allows the removal of the 2 second sleep, so the script completes much more quickly.
Also, I believe that -all should be added to the CloudPC query in case the number grows beyond 100.
$cloudPCs = Get-MgDeviceManagementVirtualEndpointCloudPC -all
Thanks again,
Martin
The text was updated successfully, but these errors were encountered:
Thanks for this code, it really helped me know where to look for this data.
I found that the signinlog query that get's repeated for each CloudPC user can be moved outside the loop with this command:
$logons = Get-MgAuditLogSignIn -Filter "startswith(devicedetail/displayname, 'CPC-') and appdisplayname eq 'Windows Sign In' and createdDateTime gt $string"
This allows the removal of the 2 second sleep, so the script completes much more quickly.
Also, I believe that -all should be added to the CloudPC query in case the number grows beyond 100.
$cloudPCs = Get-MgDeviceManagementVirtualEndpointCloudPC -all
Thanks again,
Martin
The text was updated successfully, but these errors were encountered: