Gathering Windows AutoPilot hardware details from existing machines

Published Jun 19 2019 05:45 AM 680 Views
Microsoft
First published on TechNet on Dec 12, 2017

As discussed in the documentation at https://docs.microsoft.com/en-us/windows/deployment/windows-10-auto-pilot , you can harvest the hardware details from existing Windows 10 devices, then upload those to AutoPilot via the Microsoft Store for Business, the Partner Center, or Intune (coming soon).  I published a PowerShell script called Get-WindowsAutoPilotInfo to the PowerShell Gallery that helps with gathering that info and formatting it into a CSV-style file that can be uploaded.

In order to gather the hardware details, the device must be running Windows 10 1703 or later and the script needs to be run with admin rights (elevated when running locally).  It can’t run on earlier versions of Windows, nor will it run in Windows PE.

It is possible to gather hardware details remotely, accessing WMI over the network, but the remote machine still needs to be running Windows 10 1703 or later.  With the most recent script update published last week, you can optionally provide credentials for connecting to the remote machine (not supported for the local machine); just add the “-Credential” parameter (along with the -ComputerName parameter) and specify either a PSCredential object or a user ID (which would result in prompting for the password).

If you are trying to gather the hardware details remotely, you will need to make sure that the Windows Firewall enables access to WMI.  To do that, open the “Windows Defender Firewall” control panel and click on “Allow an app or feature through Windows Defender Firewall.”  Find “Windows Management Instrumentation (WMI)” in the list and enable for both Private and Public, then click OK:

clip_image001

Or you can do the same thing via Group Policy – nothing special about what the script is doing, it just needs remote WMI access to the classes that contain the details.  The script should also accept a piped-in list of computer names, so you could grab them from AD or ConfigMgr and do a whole batch at once.

Some have also asked if it’s possible to have ConfigMgr inventory these details.  Due to the length of the hardware hash (4KB), that doesn’t work.  You could use ConfigMgr to run the PowerShell script on each machine, then collect the resulting CSV files.

%3CLINGO-SUB%20id%3D%22lingo-sub-706521%22%20slang%3D%22en-US%22%3EGathering%20Windows%20AutoPilot%20hardware%20details%20from%20existing%20machines%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-706521%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TechNet%20on%20Dec%2012%2C%202017%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EAs%20discussed%20in%20the%20documentation%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fdeployment%2Fwindows-10-auto-pilot%22%20title%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fdeployment%2Fwindows-10-auto-pilot%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fdeployment%2Fwindows-10-auto-pilot%20%3C%2FA%3E%2C%20you%20can%20harvest%20the%20hardware%20details%20from%20existing%20Windows%2010%20devices%2C%20then%20upload%20those%20to%20AutoPilot%20via%20the%20Microsoft%20Store%20for%20Business%2C%20the%20Partner%20Center%2C%20or%20Intune%20(coming%20soon).%26nbsp%3B%20I%20published%20a%20PowerShell%20script%20called%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FGet-WindowsAutoPilotInfo%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EGet-WindowsAutoPilotInfo%20to%20the%20PowerShell%20Gallery%20%3C%2FA%3Ethat%20helps%20with%20gathering%20that%20info%20and%20formatting%20it%20into%20a%20CSV-style%20file%20that%20can%20be%20uploaded.%3C%2FP%3E%0A%20%20%3CP%3EIn%20order%20to%20gather%20the%20hardware%20details%2C%20the%20device%20must%20be%20running%20Windows%2010%201703%20or%20later%20and%20the%20script%20needs%20to%20be%20run%20with%20admin%20rights%20(elevated%20when%20running%20locally).%26nbsp%3B%20It%20can%E2%80%99t%20run%20on%20earlier%20versions%20of%20Windows%2C%20nor%20will%20it%20run%20in%20Windows%20PE.%3C%2FP%3E%0A%20%20%3CP%3EIt%20is%20possible%20to%20gather%20hardware%20details%20remotely%2C%20accessing%20WMI%20over%20the%20network%2C%20but%20the%20remote%20machine%20still%20needs%20to%20be%20running%20Windows%2010%201703%20or%20later.%26nbsp%3B%20With%20the%20most%20recent%20script%20update%20published%20last%20week%2C%20you%20can%20optionally%20provide%20credentials%20for%20connecting%20to%20the%20remote%20machine%20(not%20supported%20for%20the%20local%20machine)%3B%20just%20add%20the%20%E2%80%9C-Credential%E2%80%9D%20parameter%20(along%20with%20the%20-ComputerName%20parameter)%20and%20specify%20either%20a%20PSCredential%20object%20or%20a%20user%20ID%20(which%20would%20result%20in%20prompting%20for%20the%20password).%3C%2FP%3E%0A%20%20%3CP%3EIf%20you%20are%20trying%20to%20gather%20the%20hardware%20details%20remotely%2C%20you%20will%20need%20to%20make%20sure%20that%20the%20Windows%20Firewall%20enables%20access%20to%20WMI.%26nbsp%3B%20To%20do%20that%2C%20open%20the%20%E2%80%9CWindows%20Defender%20Firewall%E2%80%9D%20control%20panel%20and%20click%20on%20%E2%80%9CAllow%20an%20app%20or%20feature%20through%20Windows%20Defender%20Firewall.%E2%80%9D%26nbsp%3B%20Find%20%E2%80%9CWindows%20Management%20Instrumentation%20(WMI)%E2%80%9D%20in%20the%20list%20and%20enable%20for%20both%20Private%20and%20Public%2C%20then%20click%20OK%3A%3C%2FP%3E%0A%20%20%3CP%3E%3CIMG%20alt%3D%22clip_image001%22%20border%3D%220%22%20height%3D%22284%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F119558i3CCF3459D688AA57%22%20title%3D%22clip_image001%22%20width%3D%22378%22%20%2F%3E%3C%2FP%3E%0A%20%20%3CP%3EOr%20you%20can%20do%20the%20same%20thing%20via%20Group%20Policy%20%E2%80%93%20nothing%20special%20about%20what%20the%20script%20is%20doing%2C%20it%20just%20needs%20remote%20WMI%20access%20to%20the%20classes%20that%20contain%20the%20details.%26nbsp%3B%20The%20script%20should%20also%20accept%20a%20piped-in%20list%20of%20computer%20names%2C%20so%20you%20could%20grab%20them%20from%20AD%20or%20ConfigMgr%20and%20do%20a%20whole%20batch%20at%20once.%3C%2FP%3E%0A%20%20%3CP%3ESome%20have%20also%20asked%20if%20it%E2%80%99s%20possible%20to%20have%20ConfigMgr%20inventory%20these%20details.%26nbsp%3B%20Due%20to%20the%20length%20of%20the%20hardware%20hash%20(4KB)%2C%20that%20doesn%E2%80%99t%20work.%26nbsp%3B%20You%20could%20use%20ConfigMgr%20to%20run%20the%20PowerShell%20script%20on%20each%20machine%2C%20then%20collect%20the%20resulting%20CSV%20files.%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-706521%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TechNet%20on%20Dec%2012%2C%202017%20As%20discussed%20in%20the%20documentation%20at%20https%3A%2F%2Fdocs.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-706521%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Emichael%20niehaus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Autopilot%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jun 19 2019 05:45 AM
Updated by: