How to get real time performance metrics like CPU, RAM, Disk of Cloud PCs (W365).

Venkata Praveen Tellajeera 20 Reputation points
2024-10-14T12:37:17.47+00:00

We are monitoring W365 CloudPCs using Microsoft Graph APIs. One example api is below:
https://graph.microsoft.com/$($apiVersion)/deviceManagement/userExperienceAnalyticsResourcePerformance

These MS Graph apis are providing historic data. We need to monitor real time performance metrics (CPU, RAM, Disk) of W365 CloudPCs. Please let us know if any apis or PowerShell commands to fetch these parameters.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,372 questions
Windows 365 Enterprise
Windows 365 Business
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,634 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZhoumingDuan-MSFT 13,965 Reputation points Microsoft Vendor
    2024-10-15T02:25:27.53+00:00

    @Venkata Praveen Tellajeera, Thanks for posting in Q&A.

    From your description, I know you want to get real time performance metrics like CPU, RAM, Disk of Cloud PCs via PowerShell.

    Based on my research, here are the PowerShell scripts to get real time CPU usage,RAM usage and Disk Usage.

    CPU Usage:

    Get-Counter -Counter "\Processor(_Total)% Processor Time" -Continuous

    RAM Usage:

    Get-Counter -Counter "\Memory\Available MBytes" -Continuous

    Disk Usage:

    Get-Counter -Counter "\LogicalDisk(_Total)% Free Space" -Continuous

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-counter?view=powershell-7.4#example-3-get-continuous-samples-of-a-counter

    Hope above information can help you.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.