AutopilotOOBE with ConfigMgr: Setting Defaults

So last time we added a CMD file to our Task Sequence to launch AutopilotOOBE.

By default you will get the below layout when running AutopilotOOBE.

Now lets customize this GUI a bit with some default values and actions.

Additional Information

Again this is straight from the documentation of AutopilotOOBE.

AutopilotOOBE Configuration Json

A configuration json file named ‘OSDeploy.AutopilotOOBE.json’ can be used to set the parameters.
Below is the example configuration json we’ll be using in our task sequence.

JSON
{
    "Title": "Michael the Admin - Autopilot Registration",
    "GroupTag": "MTA-USALPT",
    "GroupTagOptions": [
        "MTA-USALPT",
        "MTA-USAWRK"
    ],
    "AssignedUserExample": "Username@example.com",
    "AssignedComputerNameExample": "ExampleComputerName",
    "Hidden": "AddToGroup",
    "Assign": true,
    "PostAction": "Restart",
    "Docs": "https://michaeltheadmin.com"
}
When using ‘AssignedUserExample’ and ‘AssignedComputerNameExample’:

Something to keep in mind when using these two parameters, is when you select the ‘Register’ button, there are 2 checks performed on the value of these fields.

  1. First it checks if the Value is Greater than 0
    • If nothing is in the textbox, then it won’t add the value to the parameters list. Because there is nothing to add.
  2. Second it checks if the Value ‘Does NOT Match’ your example string
    • So if your UPN’s are like ‘John.Doe@companydomain.com’ and your Example string is ‘Username@companydomain.com’
    • Then it won’t use whatever value you put in the textbox because these values will ‘match’ because the ‘@companydomain.com’ is the same
    • This can also occur for computer names. So make sure your example string doesn’t contain similar characters to your naming standards.
From the AutopilotOOBE/Project/MainWindow.ps1 code on Github.

Just something I ran into when testing. Was driving me crazy why some of the values were not being passed to the Get-WindowsAutoPilotInfo script.

How do we utilize this in a Task Sequence?

Lets use a powershell script to create the ‘OSDeploy.AutopilotOOBE.json’ file.
The script will:

  1. Set the configuration parameters you want.
  2. Creat the file ‘OSDeploy.AutopilotOOBE.json’ to “C:\ProgramData\OSDeploy\OSDeploy.AutopilotOOBE.json”
    • Since we’ll be in WinPE, and this file needs to be on the Installed OS, I am hard coding ‘C:’ in the Path.
  3. Finally it will Convert the Hashtable TO json and write it to the above file.
PowerShell
<# https://MichaeltheAdmin.com

Create the file "C:\ProgramData\OSDeploy\OSDeploy.AutopilotOOBE.json"
and 'Start-AutopilotOOBE' will import the file

Working off the infromation here
https://autopilotoobe.osdeploy.com/

#>

# Set OSDCloudGUI Defaults
$Global:AutopilotOOBE = [ordered]@{
    Title           = 'Michael the Admin - Autopilot Registration'
    GroupTag        = 'MTA-USALPT'
    GroupTagOptions = @(
        'MTA-USALPT',
        'MTA-USAWRK'
    )
    AssignedUserExample         = "Username@example.com"
    AssignedComputerNameExample = 'ExampleComputerName'
    Hidden = 'AddToGroup'
    Assign = $true
    PostAction = 'Restart'
    Docs = 'https://michaeltheadmin.com'
}

# Create 'OSDeploy.AutopilotOOBE.json' - This needs to be written to the 'C:' drive
$AutopilotOOBEjson = New-Item -Path "C:\ProgramData\OSDeploy\OSDeploy.AutopilotOOBE.json" -Force

# Covert data to Json and export to the file created above
$Global:AutopilotOOBE | ConvertTo-Json -Depth 10 | Out-File -FilePath $($AutopilotOOBEjson.FullName) -Force

Create-OSDeploy.AutopilotOOBE.ps1 at main · MichaelEscamilla/MichaelTheAdmin · GitHub

Add this to your Task Sequence

Download the Full Task Sequence OSDCloudGUI_Settings_Updates-AutopilotOOBE-Default.zip
Or from Github https://github.com/MichaelEscamilla/MichaelTheAdmin

  1. Add a ‘Run PowerShell Script’ step
    • This step needs to be after the ‘Start-OSDCloudGUI’ step
    • This is because the file needs to be created within the new OS
  1. Set the Execution Policy to Bypass
  1. Select ‘Enter PowerShell script:’
    • Then select ‘Edit Script…’
  1. Paste the script into the prompt, and select ‘OK’

Save the changes, Deploy the Task Sequence if it isn’t already.

Run the Task Sequence

You should see the step run after the ‘Start-OSDCloudGUI’ step

Now when you run ‘Start-AutopilotOOBE’ you’ll notice the Configuration Json being imported

And once the GUI loads, our configurations should be set.
Even our GroupTag list has populated.

Success!

Even more ways to save time and limit mistakes.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top