Only this pageAll pages
Powered by GitBook
1 of 7

AutopilotOOBE

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Reference

Get to know

[CmdletBinding()]
param (
    [Parameter(ValueFromPipeline = $true)]
    [string]$CustomProfile,

    [ValidateSet (
        'GroupTag',
        'AddToGroup',
        'AssignedUser',
        'AssignedComputerName',
        'PostAction',
        'Assign'
    )]
    [string[]]$Disabled,

    [ValidateSet (
        'GroupTag',
        'AddToGroup',
        'AssignedUser',
        'AssignedComputerName',
        'PostAction',
        'Assign',
        'Register',
        'Run',
        'Docs'
    )]
    [string[]]$Hidden,

    [string]$AddToGroup,
    [string[]]$AddToGroupOptions,
    [switch]$Assign,
    [string]$AssignedUser,
    [string]$AssignedUserExample = '[email protected]',
    [string]$AssignedComputerName,
    [string]$AssignedComputerNameExample = 'Azure AD Join Only',
    [string]$GroupTag,
    [string[]]$GroupTagOptions,
    [ValidateSet (
        'Quit',
        'Restart',
        'Shutdown',
        'Sysprep',
        'SysprepReboot',
        'SysprepShutdown',
        'GeneralizeReboot',
        'GeneralizeShutdown'
    )]
    [string]$PostAction = 'Quit',
    [ValidateSet (
        'CommandPrompt',
        'PowerShell',
        'PowerShellISE',
        'WindowsExplorer',
        'WindowsSettings',
        'NetworkingWireless',
        'Restart',
        'Shutdown',
        'Sysprep',
        'SysprepReboot',
        'SysprepShutdown',
        'SysprepAudit',
        'EventViewer',
        'GetAutopilotDiagnostics',
        'MDMDiag',
        'MDMDiagAutopilot',
        'MDMDiagAutopilotTPM'
    )]
    [string]$Run = 'PowerShell',
    [string]$Docs,
    [string]$Title = 'Autopilot Manual Registration'
)

Parameters

AutopilotOOBE should be customized for your Client Support staff so you can ensure compliance. When testing Parameters, you can safely do this in Windows (or OOBE) on a Device that has not been Autopilot Registered yet. A Virtual Machine works quite well in accomplishing this task

Title

Start by adding a Title for your Organization

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
}
AutopilotOOBE @Params

GroupTag

For my Organization, I want the default GroupTag to be Enterprise and to include an option for Development

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
    GroupTag = 'Enterprise'
    GroupTagOptions = 'Development','Enterprise'
}
AutopilotOOBE @Params

This will ensure that it is defaulted to Enterprise

And also give an option to select Development if necessary, but the important point about this is that I have limited any errors that can happen

I also have the ability to type in a GroupTag that is not in the ComboBox as needed

Hidden

If there are options that need to be removed, use the Hidden parameter to hide the controls

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
    GroupTag = 'Enterprise'
    GroupTagOptions = 'Development','Enterprise'
    Hidden = 'AddToGroup','AssignedComputerName','AssignedUser'
}
AutopilotOOBE @Params

Assign

I strongly recomment using the Assign parameter to wait for the Device to be Registered

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
    GroupTag = 'Enterprise'
    GroupTagOptions = 'Development','Enterprise'
    Hidden = 'AddToGroup','AssignedComputerName','AssignedUser'
    Assign = $true
}
AutopilotOOBE @Params

Disabled

This parameter allows me to lock the controls, so they cannot be edited or changed if necessary

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
    GroupTag = 'Enterprise'
    GroupTagOptions = 'Development','Enterprise'
    Hidden = 'AddToGroup','AssignedComputerName','AssignedUser'
    Assign = $true
    Disabled = 'Assign','GroupTag','PostAction'
}
AutopilotOOBE @Params

Run and Docs

Finally, the Run parameter can be set to default a Run action, and the Docs ComboBox can be customized with a URL

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
    GroupTag = 'Enterprise'
    GroupTagOptions = 'Development','Enterprise'
    Hidden = 'AddToGroup','AssignedComputerName','AssignedUser','PostAction'
    Assign = $true
    Run = 'NetworkingWireless'
    Docs = 'https://autopilotoobe.osdeploy.com/'
}
AutopilotOOBE @Params

Conclusion

As you can see, almost everything in AutopilotOOBE can be set with Parameters. Use the Reference on the next page to see all the available options that you can set

Sponsors

About

AutopilotOOBE is used to manually register a Device in Intune Autopilot. It is intended to run in OOBE (Out of Box Experience) by Client Support as a "friendly" method to use Get-WindowsAutopilotInfo

PowerShell Gallery

AutopilotOOBE is published in the PowerShell Gallery

GitHub

AutopilotOOBE code can be cloned from a GitHub Repository

Sponsors

Autopilot CMD

To make things easier for my Support Staff, I like to drop an Autopilot CMD file on the OS during Deployment so they don't need to even think about Parameters or Configuration Json files

OSDHelp AutopilotOOBE

You can use OSDHelp to get the proper PowerShell code for creating an Autopilot.cmd with whatever settings you want

OOBE

Once you've created an Autopilot.cmd, you can simply press Shift + F10 to open a Command Prompt and type in Autopilot

  • Set ExecutionPolicy

  • Add PowerShell Scripts to the Path

  • Install AutopilotOOBE PowerShell Module

  • Start-AutopilotOOBE with your CustomProfile

    • or Command Line

    • or without if you have the Configuration Json saved

Sponsors

Deployment

When you are ready to deploy your AutopilotOOBE Configuration Json, there are three methods to do this

Command Line

I'd advise against this as this is quite a bit to type in, but it is absolutely possible. Good Luck!

$Params = @{
    Title = 'OSDeploy Autopilot Registration'
    GroupTag = 'Enterprise'
    GroupTagOptions = 'Development','Enterprise'
    Hidden = 'AddToGroup','AssignedComputerName','AssignedUser','PostAction'
    Assign = $true
    Run = 'NetworkingWireless'
    Docs = 'https://autopilotoobe.osdeploy.com/'
}
AutopilotOOBE @Params

CustomProfile

You can easily send me your Configuration Json and I can add it to the AutopilotOOBE PowerShell Module. Once it is published, you will be able to use it right away as long as you install the latest AutopilotOOBE PowerShell Module

In OOBE, you simply add your CustomProfile name as an AutopilotOOBE parameter and it will import the CustomProfile to your ProgramData. This will ensure that any subsequent execution of AutopilotOOBE is customized for your Organization

Configuration Json Staging

If you are going to image the Device , then you can also save the Configuration Json in WinPE after your Operating System has been expanded to the Hard Disk. This will ensure that AutopilotOOBE will always be executed with your configuration

OSDHelp AutopilotOOBE

An example on how to do this is in OSDHelp which is part of the OSD PowerShell Module

Install-Module OSD -Force
Import-Module OSD -Force
OSDHelp AutopilotOOBE

OSDCloud

If you are using OSDCloud, you can apply the Configuration Json in a method similar to the script below, after Start-OSDCloud has completed

#=======================================================================
#   OS: Params and Start-OSDCloud
#=======================================================================
$Params = @{
    OSBuild = "21H1"
    OSEdition = "Pro"
    OSLanguage = "en-us"
    OSLicense = "Retail"
    SkipAutopilot = $true
    SkipODT = $true
}
Start-OSDCloud @Params



#=======================================================================
#   PostOS: AutopilotOOBE Staging
#=======================================================================
$AutopilotOOBEJson = @'
{
    "Assign":  {
                   "IsPresent":  true
               },
    "GroupTag":  "Enterprise",
    "GroupTagOptions":  [
                            "Development",
                            "Enterprise"
                        ],
    "Hidden":  [
                   "AddToGroup",
                   "AssignedComputerName",
                   "AssignedUser",
                   "PostAction"
               ],
    "PostAction":  "Quit",
    "Run":  "NetworkingWireless",
    "Docs":  "https://autopilotoobe.osdeploy.com/",
    "Title":  "OSDeploy Autopilot Registration"
}
'@
$AutopilotOOBEJson | Out-File -FilePath "C:\ProgramData\OSDeploy\OSDeploy.AutopilotOOBE.

Sponsors

Configuration Json

Every time AutopilotOOBE is run, it automatically creates a Configuration Json in the following location, so once you have your Parameters sorted out, save the file

$env:TEMP\OSDeploy.AutopilotOOBE.json

OSDeploy.AutopilotOOBE.json

Here is what the contents looks like

{
    "Assign":  {
                   "IsPresent":  true
               },
    "AssignedUserExample":  "[email protected]",
    "AssignedComputerNameExample":  "Azure AD Join Only",
    "GroupTag":  "Enterprise",
    "GroupTagOptions":  [
                            "Development",
                            "Enterprise"
                        ],
    "Hidden":  [
                   "AddToGroup",
                   "AssignedComputerName",
                   "AssignedUser",
                   "PostAction"
               ],
    "PostAction":  "Quit",
    "Run":  "NetworkingWireless",
    "Docs":  "https://autopilotoobe.osdeploy.com/",
    "Title":  "OSDeploy Autopilot Registration"
}

ProgramData

The Configuration Json can be saved in the following location

$env:ProgramData\OSDeploy\OSDeploy.AutopilotOOBE.json

Now every time AutopilotOOBE is run, all of my captured settings will be applied automatically

Sponsors

AutopilotOOBE 21.10.26.1nuget
Logo
GitHub - OSDeploy/AutopilotOOBEGitHub
HomeRecast Software
OSDeploy is sponsored by Recast Sofrware
HomeRecast Software
OSDeploy is sponsored by Recast Software
HomeRecast Software
OSDeploy is sponsored by Recast Software
HomeRecast Software
OSDeploy is sponsored by Recast Software
HomeRecast Software
OSDeploy is sponsored by Recast Software
Logo

Usage

OOBE

The easiest way to use AutopilotOOBE is in OOBE (Out of Box Experience). Open a command prompt by pressing Shift + F10

Install AutopilotOOBE PowerShell Module

You will need to set the PowerShell Execution Policy, install the AutopilotOOBE Module, and run AutopilotOOBE. This is easy to do with the following commands

PowerShell
Set-ExecutionPolicy RemoteSigned -Force
Install-Module AutopilotOOBE -Force
Import-Module AutopilotOOBE -Force

Start-AutopilotOOBE

Once the AutopilotOOBE PowerShell Module is installed, you can start AutopilotOOBE

Start-AutopilotOOBE

This will start the following chain of events

  • PowerShell Transcript will be saved in C:\Windows\Temp

  • PowerShell Gallery (PSGallery) will be Trusted

  • Date and Time will be displayed

  • Event Log will be monitored for MDM Events

  • Network will be tested for connectivity to required Servers

    • You may need to open Firewall traffic as needed

  • Registry will be checked to determine if the Device has an Autopilot Profile

  • AutopilotOOBE GUI will be launched

Watch-AutopilotOOBEevents

Event Logs will be monitored for MDM, Autopilot, and Time events. Not all events are displayed as this is filtered to remove some unnecessary details

This PowerShell window is run minimized and remains open upon completion. You can view this for troubleshooting by pressing ALT + TAB, or review the output in the PowerShell Transcript that is saved in C:\Temp

You may find it necessary to adjust your screen resolution to see things better. You can 'Show Windows Settings' and adjust the Resolution or Scaling as needed

Test-AutopilotOOBEnetwork

This PowerShell window is run minimized and remains open upon completion. You can view this for troubleshooting by pressing ALT + TAB, or review the output in the PowerShell Transcript that is saved in C:\Temp

AutopilotOOBE GUI

AutopilotOOBE will load with all options available in an unconfigured state. From here, just set what you want and press Register to connect to Microsoft Graph

Everybody's settings are probably going to be unique. Here are the settings that are ideal for my environment

After pressing Register the following steps will be completed

  1. Get-WindowsAutopilotInfo will be installed from the PowerShell Gallery

  2. Depending on what was selected in the AutopilotOOBE GUI, parameters will be passed to Get-WindowsAutopilotInfo

  3. You will be prompted to authenticate to MSGraph using the credentials for your Tenant

  4. Next

Once you complete this step, in a few minutes your Device will be Registered. If you selected the Assign checkbox, you may have to wait up to 20 minutes for this process to complete

Sponsors

OSDeploy is sponsorted by Recast Software
HomeRecast Software
Logo
Logo
Logo
Logo
Logo
Logo