tabs-not-spaces / Intune.USB.Creator

A module containing tools to assist with the creation of a bootable WinPE USB used to provision devices for enrollment to Intune.
GNU General Public License v3.0
131 stars 43 forks source link

Issue pulling Autopilot Config #55

Open M0VENTURA opened 1 year ago

M0VENTURA commented 1 year ago

Hi, Getting the following error after connecting to our Azure environment

Grabbing Autopilot config file from Azure.. Write-Error: System.Management.Automation.CommandNotFoundException: The term 'Invoke-MgGraphRequest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

I've made sure that all required modules are installed. Apparently Microsoft has made some changes lately, not sure if that's caused it to break, or if theres something simple I'm missing.

steyrs commented 1 year ago

Hi Ben! Thank you for this awesome tool :) .. Any chance you have time to upgrade the tool to handle the changes Microsoft made in order to access Microsoft Graph? (the tool fails when it tries to grab the autopilot configuration file - and to the best of my knowledge - it all boils down to failure to access Microsoft Graph due to a whole bunch of changes made recently by Microsoft)

...

I have the same experience as @M0VENTURA

Tried following Microsofts advice on how to get the autopilot configuration profile - but to avail. Their documentation regarding this matter is outdated.

I ended up on Reddit -

:::::::::::::::::::::::::::: This is how it's supposed to be done using the SDK:

Import-Module Microsoft.Graph.DeviceManagement.Enrolment

Select-MgProfile beta

Connect-MgGraph -scopes 'DeviceManagementServiceConfig.Read.All'

Get-MgDeviceManagementWindowAutopilotDeploymentProfile

Typos and all. :) ::::::::::::::::::::

If my coding skills were adequate I would do it myself - but unfortunately we are not there yet.

Thanks in advance - and thank you for any update regarding this matter

rheibel commented 8 months ago

Excellent tool but the same issue needs updating to cope with the Microsoft changes luckily I already made several USB's and its fairly simple to manually copy over the install.wim to the correct location but would really appreciate a fix for admins just finding this tool.

tabs-not-spaces commented 8 months ago

For full clarity, further work on getting the offline autopilot profile will not be completed because of known issues with delays in applying device policies to a device that isn't joined prior to onboarding. I am happy to discuss further - but not in the comments section of a blog post.

On Fri, 19 Jan 2024, 7:20 am rheibel, @.***> wrote:

Excellent tool but the same issue needs updating to cope with the Microsoft changes luckily I already made several USB's and its fairly simple to manually copy over the install.wim to the correct location but would really appreciate a fix for admins just finding this tool.

— Reply to this email directly, view it on GitHub https://github.com/tabs-not-spaces/Intune.USB.Creator/issues/55#issuecomment-1899147248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIDA4LIZVDACDM6M4S6U4ATYPF7W7AVCNFSM6AAAAAAZX4WGTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGE2DOMRUHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>