cancel
Showing results for 
Search instead for 
Did you mean: 

PowerShell-Function Get-SystemReport with details on SystemInfo, Battery and Uptime

JuergenKlaassen
Rising Star III
Rising Star III

Hello

it's me again... I'm clearing my backlog of stuff I wanted to write about and here's the next one. Had this script basically ready, but lying around for a bit, pending to be covered here. 😉 

We all need some form of reports all the time and while there are some within the platform out of the box, there may be a desire to get reports with different sets of data and details.
For example you want to get details about the uptime of devices or their battery status/condition or other available data via System Insights (SI). 

I wrote a function in Powershell which offers this and you can also use it as a framework to enhance with other tables from SI by using the Get-JcSdkSystemInsight...commandlets. (list here).

How to use it?

SCR-20230504-noar-2.png

  1. call (1) Get-SystemReport and add the parameters as desired
  2. the table will be displayed as seen in the screenshot and a CSV is exported
    1. System ID, Hostname, User, OS, OS Version are sourced from Get-JCSystem
    2. details like Uptime, Battery and SystemInfo are sourced from
      Get-JcSdkSystemInsightUptime
      Get-JcSdkSystemInsightBattery
      Get-JcSdkSystemInsightSystemInfo

I left some comments in the code itself about the extensibility of this function if you need any other details in this function to get your desired reports done. 

<#
.COMPONENT
    Get-SystemReport

.DESCRIPTION
    This script will generate a report of all systems in JumpCloud. The report will include the following information:
    - System ID
    - Hostname
    - User
    - Days
    - Hours
    - Minutes
    - Seconds
    - Total Uptime (s)
    - Battery Health
    - Battery State
    - Battery Manufacturer
    - Battery Model
    - Battery Serial Number
    - Battery Cycle Count
    - Battery Capacity (%)
    - CPU Brand
    - CPU Type
    - Hardware Model
    - Hardware Serial
    - Physical Memory
    ... and more

    The report will be displayed in a table format and exported to a CSV file.

.PARAMETER IncludeUptime
    Include system uptime information in the report.

.PARAMETER IncludeBattery  
    Include battery information in the report.

.PARAMETER IncludeSystemInfo
    Include system information in the report.

.EXAMPLE    
    Get-SystemReport -IncludeBattery -IncludeSystemInfo -IncludeUptime
    This example will generate a report of all systems in JumpCloud. 
    The report will include system uptime, battery, and system information.

.NOTES

    Author:         Juergen Klaassen

    Last Updated:   2023-"may the 4th be with you"

    Version:        1.0

    Change Log:

        1.0     2023-05-04      Initial release.

.REQUIREMENTS
    - JumpCloud PowerShell module 
    - PowerShell 5.1 or later
    - A JumpCloud API key with at least Read permissions

.LINK
    Repo: https://github.com/juergen-kc/JumpCloud/blob/main/JC%20-%20Get-SystemReport.ps1
#>


Thanks for reading 
-Juergen

0 REPLIES 0
You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.