top of page
  • Writer's pictureshishir kushawaha

PowerShell to keep records of devices provisioned with Autopilot

In today's fast-paced IT landscape, efficiently managing deployment records and generating customized reports are crucial for organizations. However, tracking systems that have undergone Autopilot provisioning or image deployment, applying filters based on make, model, or deployment date, and preparing monthly reports can be time-consuming. Thankfully, PowerShell scripting offers a powerful solution to automate these tasks, simplifying record-keeping and report generation. In this blog post, we'll explore a PowerShell script that creates deployment records and generates an HTML report, providing a streamlined approach to managing and reporting deployment activities.


This script is not using any SQL or other database management system to keep records of data. It is using .csv file. The subsequent records are appended.

When it comes to managing deployment records effectively, this PowerShell script can be seamlessly incorporated into an ESP (Enrollment Status Page) or run it once logged on for first time or added at the end of a task sequence. By doing so, organizations can effortlessly capture crucial hardware and software information during the provisioning or image deployment process, while also maintaining a record of the completion date.

Upon execution, the script captures essential hardware details such as disk size, TPM (Trusted Platform Module), and serial number, providing valuable insights into the deployed systems. Additionally, it gathers relevant software information to complement the hardware data.


Once the script has collected all the necessary information, it saves the data to a CSV file. The CSV file acts as a centralized repository for deployment records, allowing for easy retrieval and analysis.


To enhance data visualization and reporting, the script offers the capability to import the contents of the CSV file and convert them into an HTML report. The HTML report provides a user-friendly format, presenting the captured information in a well-organized table structure. Moreover, the report incorporates CSS formatting, ensuring a visually appealing and professional-looking output.


You can explore GitHub repositories to find scripts related to deployment record management and PowerShell automation. The flexibility of this script allows for further customization based on specific requirements. If you desire to include additional information from the Autopilot process, such as data retrieved from the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning\Diagnostics\AutoPilot" registry, you can easily incorporate it into the script. This enables the capture of more comprehensive details during deployment.


Similarly, if you are utilizing a task sequence, you can leverage task sequence variables to store and retrieve additional information relevant to your deployment. This capability provides the opportunity to expand the scope of data collection and enhance the richness of the deployment records.


Note:

Before executing the script, ensure that the necessary variables and configurations are properly set up to meet your specific requirements. Also create the .CSV file with all required columns in advance in share path.
Please note that when utilizing scripts from GitHub repositories, it's essential to respect any licensing or usage guidelines provided by the repository owner.
Additionally, be sure to give appropriate credit to the original author when incorporating their script into your workflow.
727 views0 comments

Recent Posts

See All

PowerShell Flow Control and Conditional Statements

PowerShell Flow Control and Conditional Statements are fundamental concepts that allow you to control the execution flow of your scripts based on specific conditions. They provide the flexibility to m

Comments


bottom of page