05-04-2023 04:07 AM
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?
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
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.