-
Installation Guide
-
Admin Guides
-
User Guides
-
References
Windows Inventory Collection Script
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.
- Warranty information for Dell, Lenovo, and Getac computers.
- M365 update installation and compliance details.
- Windows driver inventory.
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.
Prerequisites:
- Appropriate licenses to use remediation scripts in Intune.
- Dell requires an API token in order to access their warranty API. You must apply for the token at https://techdirect.dell.com/Portal/APIs.aspx
- Lenovo requires a client token in order to access their warranty API. Getting the token from Lenovo can be a bit more difficult than getting a token from Dell. You will need to have your Lenovo account rep request a key on your behalf.
You can copy the PowerShell script from our Github repository.
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 2
- If you plan to collect warranty data, you might want to consider having two versions of the Intune Windows Inventory script. You really only need to collect the warranty data every 30 days, but you likely want to collect the rest of the data every day. Hitting the manufacturer API's over and over every day might get your API key revoked.
- Set $CollectWarranty = $true in one script and set it to $false in another. Run the one that is $true every 25-30 days. Run the other one every day.
Step 3
- If applicable enter the Dell Client ID and Client Secret values. When you retrieve this info from TechDirect it will be in a format similar to xxxxxxxxxx (yyyyyyyyy). The part before the opening parenthesis is the Client ID, the part inside the parenthesis is the Client Secret. (Note: Do not enter the parenthesis themselves in the script)
- If applicable enter the Lenovo Client ID provided to you by your Lenovo account rep.
Step 7
Step 8
- Optionally add Scope tags.
- Select Next.
