I am looking to use a powershell script to WMI query the computer during post-install of the imaging sequence via MDT/SCCM. Actively there are multiple VB scripts to accomplish parts of the System Properties area (Manufacturer, Model, InstallDate, SerialNumber, etc.), and would like to consolidate this into a single script that does it all.
Running Powershell ISE as Administrator, so that wouldn't be causing for any permissions issues; the model information returns Macbook as I am testing on Windows 10 through Bootcamp.
Clear-Host
$Model = (Get-WmiObject -Class:Win32_ComputerSystem).Model
$RegKey = “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\OEMInformation”
New-Item -Path $RegKey -Name Model -Type String -Value $Model –Force
After I ran the script, these were the results (shown below).
Name Property
----- --------
Model (default) : MacBookPro11,1
However the value is not written to the registry. How could I go about the writing of the informaiton to the registry, while also allowing for multiple variables to be aligned in addition? All the values (subkeys) would need to be created and be placed at the same Registry Path of "OEMInformation".
Aim to include for Manufacturer, Model, Name, InstallDate, SystemType as well.