Cloud PC Usage Report With PowerShell

By | June 27, 2022


Knowing how often users connect to their Cloud PC gives you an idea if they are using it or not. From here, you can investigate if there is a reason for a user not to use the Cloud PC as first intended. Ultimately you can track down the users who no longer need a Cloud PC and can save that license cost. as you might know, there is no built-in usage report in the MEM portal. Therefore I have cooperated with Donna Ryan on a PowerShell script that will gather information about login count over a period and the last login date.

Before executing the script

Please get the latest script from the Windows 365 Github Repo and save it as .ps1 file. You can also run it directly from the PowerShell editor.

There are two variables to consider before running the script.

$offset: Define over many days you would like to get the login count. If I want to get the login count for the past week, specify 7 in the parameter.

$logpath: If this parameter is defined, it will output a .csv file to that path.

There will be output in the PowerShell window. It can, however, be challenging to get a complete overview if there are many Cloud PC devices.

Script execution

Running the script is very simple. All the modules needed will automatically be installed. Now you just run the script with the specified parameters as you wish and log in with an administrator account that has access to read Cloud PC and Azure AD device information and read sign-in logs of users in Azure AD.

Final thoughts

Getting a report of login count and last logon time helps to understand the users’ usage of Windows 365. Some users might not use the environment as first intended, maybe because of performance or configuration issues you might never hear about. But now you can look into the usage and better understand if you can free up some licensing costs or investigate with some specific users if there is some configuration that needs to be changed for their usage.

Remember to follow the Windows 365 Github Repo. There are some handy scripts, and I’m sure more will come over time.

5 thoughts on “Cloud PC Usage Report With PowerShell

  1. Pingback: Weekly Newsletter – 25th June to 1st July 2022 - Windows 365 Community

  2. Walter Riopedre

    This report is useful. Thanks. Wondering if there is a way to get the actual usage per user. Like how long were the users connected during the specified period. Like 30 hours in the last 7 days.

    1. Morten Pedholt Post author

      Hi Walter,

      That could be really cool. i however dont think it would be possible at the moment to get that data.

  3. Sean McNeill

    Morten, great script idea, I am having trouble running it, getting errors on CMDLET names, it appears maybe an update to a Module changed the CMDLET names?
    ping me directly for specifics

    1. Morten Pedholt Post author

      Hi Sean,

      Please ping me at twitter @mortenpedholt


Leave a Reply

Your email address will not be published.