Jul 05 2018 05:31 AM - edited Nov 08 2019 02:08 AM
Hi All
Just a Tip from me to make it easier (if you got other ways, let me know, would be interested)
Starting to deploy via Autopilot but first grabbing the information - so I am using a USB Drive with the following :
Plug in the USB Drive..
Right Click the file ..GetAutoPilot.cmd and (run as Administrator) (it seems everytime I plug in the USB I get D: Drive but with the updated command below its automatic )
Prepare Files
1) GetAutoPilot.cmd
2) Download a copy of Get-WindowsAutoPilotInfo.ps1
Contents of GetAutoPilot.cmd
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~d0\Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~d0\computers.csv -append
Get-WindowsAutoPilotInfo.ps1 - downloaded from powershellgallery
https://www.powershellgallery.com/packages/Get-WindowsAutoPilotInfo/1.6
What it does...
It quickly dumps the CSV file onto the USB Drive and now I have all the CSV Files that I need in one file ready to upload to intune.
Then unplug and move onto the next device ...
Easy !
Simon Allison
May 02 2022 05:51 AM
May 11 2022 07:42 AM
May 17 2022 09:29 AM - edited May 17 2022 09:33 AM
your code is missing the slashes : (Copy and paste issue?)
example:
-OutputFile %~dp0compHash.csv -append
My script:
-OutputFile %~d0\computers.csv -append
It should output the computer name , hope this helps
May 18 2022 01:01 AM
May 24 2022 09:48 AM
@davewilliamson I've found that HP systems don't like %~dp0compHash.csv but if I use "compHash.csv it works. Dell doesn't have any issues running %~dp0compHash.csv
May 24 2022 02:20 PM
May 24 2022 03:16 PM
@Simon Allison this code didn't work for me on HP:
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~dp0compHash.csv -append
so I just removed all the %~dp0 references, I also don't think either could define ComputerName $env:computername. I ran the below w/out any issues on both Dell and HP
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command Get-WindowsAutoPilotInfo.ps1 - -OutputFile compHash.csv -append
But for non-OOBE boxes, there's a new CIM error being thrown:
Get-CimInstance : A general error occurred that is not covered by a more specific error code.
At D:\Autopilot\Get-WindowsAutoPilotInfo.ps1:209 char:23
... evDetail = (Get-CimInstance -CimSession $session -Namespace root/cimv
the error is due to new KB5013942 or KB5011831
Once the KB(s) is uninstalled, the code runs. For me on W10 21H2 it was KB5013942. I have no idea if MS knows their update caused an issue or if there's a fix in the pipeline.
Feb 28 2023 04:17 PM
May 30 2023 07:25 AM
@Harm_Veenstra, hi man! Did you manage to use it?
The documentation says that we need Intune admin to get the hash uploaded but when trying it says I don't have the permission.
May 30 2023 02:36 PM