Forum Discussion
Get-WindowsAutoPilotInfo - A quicker way...
Thanks SimonAllison - I'll give it a go today... 🙂
I have just tested and there is an error, but this one works - all I did was remove the "p" as this gives the path and not just the drive. updating scripts
@ECHO ON
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~d0\Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~d0\$env:computername.csv
- Andycap147Nov 09, 2020Copper Contributor
SimonAllison Do you know if it's possible to use this without completing Windows setup. ie During OOBE after networking has been setup?
- AcominatusMar 04, 2022Copper Contributor
Andycap147 Yes, pressing Caps+F10
- SimonAllisonDec 15, 2020Iron Contributor
Andycap147 the whole process was designed that I know of to run under OOBE, you cant do it on pre-existing setups as it was all designed to run out of the box on new surface devices, as in the background and permissions, and apps etc are from Azure AD and Intune.
I was looking for the same setup where you could use pre-existing windows setups, but sadly it wasnt the case, as you would loose all existing apps.
sorry for the late reply
- Mr_CuddyOct 21, 2021Copper Contributor
Instead of
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0\Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~dp0\computers.csv -append,
Leave out the -ComputerName variable:
PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0\Get-WindowsAutoPilotInfo.ps1 -OutputFile %~dp0\computers.csv -append
This defaults the script to localhost, which is what the script sees (I believe) in the OOB screen. Either way, it works.
- firebladezNov 11, 2019Copper Contributor
hi SimonAllison - sorry could not get this to work - after running the cmd as admin it had a heap of error then the powershell page closed - it was something like, the client can not connect to the destination specified in the request - and you can not call a method on a null-valued expression... this is what I managed to get from the quick vid I got on my phone
- AndrewSkouldingJan 03, 2020Copper Contributor
firebladezI had to run the following in an elevated CMD prompt:
winrm quickconfig
That fixed the mass of red being thrown back from the PS script. Hope this helps you
- muscleflexMay 20, 2021Copper ContributorI got mine to work after your tip... but do I have to run this on all the machines first? Any way of adding this to the cmd file?