-
Installation Guide
-
Admin Guides
-
User Guides
-
References
Print
Windows Inventory Collection Script
Copy the URL link to this section to share
Many customers have requested the ability to report on things that are either not collected or not accurately collected by Intune. In an effort to fill these gaps in we have implemented a custom solution to collect some of the most commonly requested items. Currently this list includes:
- Software installed on Windows 10 devices.
- Software installation date.
- Monitors (LCD’s) connected to Windows 10 devices.
- Disk health.
- Last Reboot time.
- Additional CPU details.
- Additional RAM details.
- Battery health.
- Friendly model names for Lenovo computers.
This data is collected via PowerShell, sent to a Log Analytics workspace, and then pulled into Power BI. Most customers leverage a Proactive Remediation detection to run the PowerShell script on a defined schedule. In this document we describe how to configure the script and deploy it using a Proactive Remediation however there are many ways that you might run a script on a schedule.
You can copy the PowerShell script from below.
Step
Step 1
- Paste the PowerShell code into your favorite script editor.
- On the line starting with $CustomerId = enter your Log Analytics Workspace ID between the quotes.
- On the line starting with $SharedKey = enter your Log Analytics Workspace Primary Key between the quotes.
- Save the script as a .ps1 file. For example CollectInventory.ps1.
Step
Step 2
- In the Intune console select Reports
- Select Endpoint analytics.
Step
Step 3
- Select Proactive remediations.
- Select Create script package.
Step
Step 4
- Enter a Name.
- Enter a Description.
- Select Next.
Step
Step 5
- For the Detection script file, browse to and select the Inventory.ps1 file.
- Select Yes to run script in 64-bit PowerShell.
- Select Next.
Step
Step 6
- Optionally add Scope tags.
- Select Next.
Step
Step 7
- Select the devices from which you want to collect inventory.
- Adjust the schedule per your requirements.
- Select Next.
Step
Step 8
- Confirm all of the settings are correct.
- Select Create.