Get-WindowsAutoPilotInfo - A quicker way...

%3CLINGO-SUB%20id%3D%22lingo-sub-312179%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-312179%22%20slang%3D%22en-US%22%3Eif%20you%20add%20a%20-append%20to%20your%20cmd%20it%20will%20keep%20all%20the%20hardware%20IDs%20in%20the%20same%20csv%2C%20making%20it%20easier%20to%20upload%20to%20intune%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-472575%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-472575%22%20slang%3D%22en-US%22%3ESlight%20improvement%20to%20your%20batch%20file%2C%20added%20-append%20and%20set%20the%20drive%20letters%20to%20be%20the%20drive%20the%20bat%20file%20is%20executed%20from%3A%3CBR%20%2F%3E%3CBR%20%2F%3EPowerShell%20-NoProfile%20-ExecutionPolicy%20Unrestricted%20-Command%20%25~dp0%5CGet-WindowsAutoPilotInfo.ps1%20-ComputerName%20%24env%3Acomputername%20-OutputFile%20%25~dp0%5Ccomputers.csv%20-append%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-982039%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-982039%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F323520%22%20target%3D%22_blank%22%3E%40mac-e%3C%2FA%3E%26nbsp%3Bupdated!%20thanks%20makes%20it%20even%20easier%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-985548%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-985548%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3B-%20do%20you%20have%20a%20link%20to%20the%20files%20that%20I%20can%20put%20onto%20a%20usb%20stick%20please%3F%20struggling%20to%20get%20this%20to%20work...%20ta%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-993657%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-993657%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F446504%22%20target%3D%22_blank%22%3E%40firebladez%3C%2FA%3E%26nbsp%3BTry%20these%2C%20put%20them%20on%20the%20USB%20stick%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20run%20them%20with%20the%20OS%20installed%20and%20through%20OOBE%20stage%20you%20can%20get%20to%20the%20command%20prompt%20by%20pressing%20%2C%3CSPAN%3E%26nbsp%3Bpress%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EShift%20%2B%20F10%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20put%20them%20here...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fsimonallisonuk%2FScripts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fsimonallisonuk%2FScripts%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-994180%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-994180%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3B-%20I'll%20give%20it%20a%20go%20today...%20%3A)%3C%2Fimg%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-994670%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-994670%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F446504%22%20target%3D%22_blank%22%3E%40firebladez%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20just%20tested%20and%20there%20is%20an%20error%2C%20but%20this%20one%20works%20-%20all%20I%20did%20was%20remove%20the%20%22p%22%20as%20this%20gives%20the%20path%20and%20not%20just%20the%20drive.%26nbsp%3B%20updating%20scripts%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%40ECHO%20ON%3CBR%20%2F%3EPowerShell%20-NoProfile%20-ExecutionPolicy%20Unrestricted%20-Command%20%25~d0%5CGet-WindowsAutoPilotInfo.ps1%20-ComputerName%20%24env%3Acomputername%20-OutputFile%20%25~d0%5C%24env%3Acomputername.csv%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-212393%22%20slang%3D%22en-US%22%3EGet-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-212393%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20a%20Tip%20from%20me%20to%20make%20it%20easier%26nbsp%3B%20(if%20you%20got%20other%20ways%2C%20let%20me%20know%2C%20would%20be%20interested)%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EStarting%20to%20deploy%20via%20Autopilot%20but%20first%20grabbing%20the%20information%20-%20so%20I%20am%20using%20a%20USB%20Drive%20with%20the%20following%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlug%20in%20the%20USB%20Drive..%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERight%20Click%20the%20file%20..%3CSTRONG%3EGetAutoPilot.cmd%20%3C%2FSTRONG%3Eand%3CSTRONG%3E%20(run%20as%20Administrator)%3C%2FSTRONG%3E%26nbsp%3B%26nbsp%3B%20(it%20seems%20everytime%20I%20plug%20in%20the%20USB%20I%20get%20D%3A%3C%2Fimg%3E%20Drive%20but%20with%20the%20updated%20command%20below%20its%20automatic%20)%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPrepare%20Files%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%26nbsp%3BGetAutoPilot.cmd%3C%2FP%3E%3CP%3E2)%20Download%20a%20copy%20of%26nbsp%3B%3CSTRONG%3EGet-WindowsAutoPilotInfo.ps1%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EContents%20of%20GetAutoPilot.cmd%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EPowerShell%20-NoProfile%20-ExecutionPolicy%20Unrestricted%20-Command%20%25~d0%5CGet-WindowsAutoPilotInfo.ps1%20-ComputerName%20%24env%3Acomputername%20-OutputFile%20%25~d0%5Ccomputers.csv%20-append%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EGet-WindowsAutoPilotInfo.ps1%20-%20downloaded%20from%20powershellgallery%20%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FGet-WindowsAutoPilotInfo%2F1.6%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FGet-WindowsAutoPilotInfo%2F1.6%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20it%20does...%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20quickly%20dumps%20the%20CSV%20file%20onto%20the%20USB%20Drive%20and%20now%20I%20have%20all%20the%20CSV%20Files%20that%20I%20need%20in%20one%20file%20ready%20to%20upload%20to%20intune.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20unplug%20and%20move%20onto%20the%20next%20device%20...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEasy%20!%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESimon%20Allison%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-998461%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-998461%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3BHi%20was%20having%20difficulty%20getting%20info%20in%20the%20computers.csv%20but%20ran%20Winrm%20quickconfig.%3C%2FP%3E%3CP%3ENow%20I%20get%20%22default%20String%22%20under%20device%20serial%20no.%20%3A%20nothing%20in%20windows%20%3B%20and%20a%20very%20long%20string%20of%20letters%20under%20hardware%20hash.%20No%20column%20for%20computer%20name.%3C%2FP%3E%3CP%3EAny%20thoughts%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-998821%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-998821%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3B-%20sorry%20could%20not%20get%20this%20to%20work%20-%20after%20running%20the%20cmd%20as%20admin%20it%20had%20a%20heap%20of%20error%20then%20the%20powershell%20page%20closed%20-%20it%20was%20something%20like%2C%20the%20client%20can%20not%20connect%20to%20the%20destination%20specified%20in%20the%20request%20-%20and%20you%20can%20not%20call%20a%20method%20on%20a%20null-valued%20expression...%20this%20is%20what%20I%20managed%20to%20get%20from%20the%20quick%20vid%20I%20got%20on%20my%20phone%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1087198%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1087198%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F446504%22%20target%3D%22_blank%22%3E%40firebladez%3C%2FA%3EI%20had%20to%20run%20the%20following%20in%20an%20elevated%20CMD%20prompt%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewinrm%20quickconfig%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20fixed%20the%20mass%20of%20red%20being%20thrown%20back%20from%20the%20PS%20script.%20Hope%20this%20helps%20you%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1171355%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1171355%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHello%2C%20thanks%20for%20the%20tip.%3C%2FP%3E%0A%3CP%3EI%20have%20added%20the%20following%20command%20on%20the%20cmd%20as%20it%20does%20not%20work%20if%20Windows%20management%20service%20is%20disabled%20and%20it%20was%20on%20my%20machines%20%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3Enet%20start%20WManSvc%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%2C%3C%2FP%3E%0A%3CP%3EYohan.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1624586%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624586%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20where%20i%20ran%20into%20was%20that%20you%20cannot%20run%20the%20Script%20when%20you%20are%20in%20a%20Public%20Network.%3C%2FP%3E%3CP%3Eyou%20need%20to%20change%20it%20to%20Private.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20it%20runs%20ok.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20alot.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1867385%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1867385%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3BDo%20you%20know%20if%20it's%20possible%20to%20use%20this%20without%20completing%20Windows%20setup.%26nbsp%3B%20ie%20During%20OOBE%20after%20networking%20has%20been%20setup%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1988325%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1988325%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F862560%22%20target%3D%22_blank%22%3E%40Andycap147%3C%2FA%3E%26nbsp%3Bthe%20whole%20process%20was%20designed%20that%20I%20know%20of%20to%20run%20under%20OOBE%2C%20you%20cant%20do%20it%20on%20pre-existing%20setups%20as%20it%20was%20all%20designed%20to%20run%20out%20of%20the%20box%20on%20new%20surface%20devices%2C%20as%20in%20the%20background%20and%20permissions%2C%20and%20apps%20etc%20are%20from%20Azure%20AD%20and%20Intune.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20looking%20for%20the%20same%20setup%20where%20you%20could%20use%20pre-existing%20windows%20setups%2C%20but%20sadly%20it%20wasnt%20the%20case%2C%20as%20you%20would%20loose%20all%20existing%20apps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Esorry%20for%20the%20late%20reply%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2371299%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2371299%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F80386%22%20target%3D%22_blank%22%3E%40Simon%20Allison%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can't%20get%20this%20to%20run...%20but%20if%20i%20run%20the%20get-windowsautopilot.ps1%20manually%2C%20it%20works%20fine%20so%20something%20in%20that%20cmd%20file%20is%20not%20running%20for%20me.%20i%20can%20type%20them%20line%20by%20line%20and%20it%20works%20up%20to%20opening%20powershell%20but%20that's%20it.%20after%20i've%20opened%20up%20powershell%20from%20the%20cmd%20prompt%2C%20then%20i'm%20stuck%20and%20i%20can't%20get%20the%20last%20bit%20of%20your%20code%20working.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2371301%22%20slang%3D%22en-US%22%3ERe%3A%20Get-WindowsAutoPilotInfo%20-%20A%20quicker%20way...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2371301%22%20slang%3D%22en-US%22%3EI%20got%20mine%20to%20work%20after%20your%20tip...%20but%20do%20I%20have%20to%20run%20this%20on%20all%20the%20machines%20first%3F%20Any%20way%20of%20adding%20this%20to%20the%20cmd%20file%3F%3C%2FLINGO-BODY%3E
Occasional Contributor

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    

 

16 Replies
if you add a -append to your cmd it will keep all the hardware IDs in the same csv, making it easier to upload to intune
Slight improvement to your batch file, added -append and set the drive letters to be the drive the bat file is executed from:

PowerShell -NoProfile -ExecutionPolicy Unrestricted -Command %~dp0\Get-WindowsAutoPilotInfo.ps1 -ComputerName $env:computername -OutputFile %~dp0\computers.csv -append

@mac-e updated! thanks makes it even easier

@Simon Allison - do you have a link to the files that I can put onto a usb stick please? struggling to get this to work... ta

@firebladez Try these, put them on the USB stick 

I did run them with the OS installed and through OOBE stage you can get to the command prompt by pressing , press Shift + F10

 

I have put them here...

 

https://github.com/simonallisonuk/Scripts

 

 

Thanks @Simon Allison - I'll give it a go today... :) 

@firebladez 

 

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

@Simon Allison Hi was having difficulty getting info in the computers.csv but ran Winrm quickconfig.

Now I get "default String" under device serial no. : nothing in windows ; and a very long string of letters under hardware hash. No column for computer name.

Any thoughts?

 

 

hi @Simon Allison - 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 

@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

 

@Simon Allison 

 

Hello, thanks for the tip.

I have added the following command on the cmd as it does not work if Windows management service is disabled and it was on my machines : 

net start WManSvc

 

Thanks,

Yohan.

@Simon Allison 

 

The problem where i ran into was that you cannot run the Script when you are in a Public Network.

you need to change it to Private.

 

Then it runs ok.

 

Thanks alot. :)

@Simon Allison Do you know if it's possible to use this without completing Windows setup.  ie During OOBE after networking has been setup?

@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 

@Simon Allison 

I can't get this to run... but if i run the get-windowsautopilot.ps1 manually, it works fine so something in that cmd file is not running for me. i can type them line by line and it works up to opening powershell but that's it. after i've opened up powershell from the cmd prompt, then i'm stuck and i can't get the last bit of your code working.

I 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?