Manage Autopilot with PowerShell: More features


The WindowsAutopilotIntune PowerShell module allows you to manage Autopilot. In this post, I will show you an update I did on this module on my lab in order to add more options.
Indeed I will show you how to set a deployment profiles and manage enrollment status page (add, set, list, remove) with PowerShell.

What's this module ?
This is a quick reminder.
The WindowsAutopilotIntune module has been published by Michael Niehaus.
This module contains by default the below cmdlets:

My updates
In my lab I created the below cmdlets:
-> Set-AutopilotProfile: Change deployment profile options
-> Remove-AutoPilotProfile: Remove a Deployment Profile
-> Set-AutoPilotProfileAssignedGroup: Assign a group to a Deployment Profile 
-> Remove-AutoPilotProfileAssignedGroup: Remove a group from a Deployment profile
-> Get-AutoPilotProfileAssignedDevice: List assigned devices for a Deployment Profile
-> Get-AutoPilotProfileAssignments: List assigned groups for a Deployment Profile
-> Add-EnrollmentStatusPage: Create an Enrollment Status Page
-> Get-EnrollmentStatusPage: List Enrollment Status Page
-> Set-EnrollmentStatusPage: Change Enrollment Status Page option
-> Remove-EnrollmentStatusPage: Remove an Enrollment Status Page

Where to get it?

Set Deployment Profile
Which cmdlet ?
Set-AutoPilotProfile
What id does exactly ?
By default this cmdlet allows you to change the default language of the device.
In my update of the module I added the below changes to this cmdlet:
- Hide EULA
- Hide privacy settings
- Skip the keyboard selection page
- Change display name
- Change description
- Add device template name
- Change option to hide or not the change account options
- Configure the value "Convert all targeted devices to Autopilot"
How to use it ?
Type Set-AutoPilotProfile with at least the ID of the profile to set.
See below available parameters:
Cmdlet in action
See below my existing profile option before the change.

I will change the below options:
- Description: Testing profile
- Hide EULA: Yes
- Hide privacy settings: Yes
See below the cmdlet in action:

See below the result from Intune:


Create a Deployment Profile
Which cmdlet ?
Add-AutoPilotProfile
What it does exaclty ?
It will create a new Deployment Profile with selected options.
How to use it ?
Type Add-AutoPilotProfile with at least the display name of the profile to create.
See below available parameters.
Cmdlt in action
See below the list of profiles before, from Intune:

See below the cmdlet in action:

See below the list of profiles after:


Remove Deployment Profile
Which cmdlet ?
Remove-AutoPilotProfile
What it does exaclty ?
It will remove a specific Deployment Profile from Intune.
How to use it ?
Type Remove-AutoPilotProfile with the ID of the profile to remove.
To get the profile ID use the Get-DeploymentProfile cmdlet or click on the profile from Intune. You can find the ID in the address bar, as below:

Cmdlet in action
See below the list of Deployment Profile from the Intune portal.
See below the cmdlet in action:
See below the list of Deployment Profile after the remove step:


Assign group to a Deployment Profile
Which cmdlet ?
Set-AutoPilotProfileAssignedGroup
What it does exaclty ?
It will assign a specific Azure AD group to a specific Deployment Profile
How to use it ?
Type Set-AutoPilotProfileAssignedGroup with the ID of the profile and the ID of the group, as below:
Cmdlet in action
See below the Deployment Profile assignments options before the update, from the Intune portal:
We will add the group Autopilot Devices
To get the ID of the group, you can use the Get-AzureADGroup.
See below the cmdlet in action to assign the group:

See below the Deployment Profile assignments options after the update, from the Intune portal:

Remove an assigned group from a Deployment Profile
Which cmdlet ?
Remove-AutoPilotProfileAssignedGroup
What it does exaclty ?
It will remove a specific group from a specific Deployment Profile.
How to use it ?
Type Remove-AutoPilotProfileAssignedGroup with the ID of the profile and the ID of the group to remove.
Cmdlet in action
See below the Deployment Profile assignments options before the update, from the Intune portal:

See below the Deployment Profile assignments options after the update, from the Intune portal:



List assigned devices for a Deployment Profile
Which cmdlet ?
Get-AutoPilotProfileAssignedDevice
What it does exaclty ?
It will list all devices that have been assigned to the specific profile.
How to use it ?
Type Get-AutoPilotProfileAssignedDevice with the ID of the profile.
Cmdlet in action
See below the assigned devices for the Profile "SD Autopilot - Demo" from the Intune portal.

See below the list of assigned devices from the cmdlet:


List assigned groups for a Deployment Profile
Which cmdlet ?
Get-AutoPilotProfileAssignments
What it does exaclty ?
It will list all devices that have been assigned to the specific profile.
How to use it ?
Type Get-AutoPilotProfileAssignments with the ID of the profile,as below:
Cmdlet in action
See below the assigned devices for the Profile "SD Autopilot - Demo" from the Intune portal.

See below the list of assigned devices from the cmdlet:

Create a new Enrollment Status Page
Which cmdlet ?
Add-EnrollmentStatusPage
What it does exaclty ?
It will create a new Enrollment Status Page
How to use it ?
Type Add-EnrollmentStatusPage with at least the display name of the page.
Cmdlet in action
See below the cmdlet in action:

See below the enrollment status page from Intune:

List Enrollment Status Page
Which cmdlet ?
Get-EnrollmentStatusPage
What it does exaclty ?
This will display settings from your Enrollment Status Pages.
How to use it ?
Type Get-EnrollmentStatusPage with the ID of the status page.
Yu can find the Enrollment page ID from the Intune portal, in the addresss bar.
Cmdlet in action
See below all Enrollment Status Page from the Intune portal:

See below an overview from the module:


Remove an Enrollment Status Page
Which cmdlet ?
Remove-EnrollmentStatusPage
What it does exaclty ?
It will allow you to remove a specific Enrollment Status Page from Intune.
How to use it ?
Type Remove-EnrollmentStatusPage with the ID of the status page.

Set-EnrollmentStatusPage
What it does exaclty ?
This allows you to set the below opions for a specific enrollment status page:
- Display name
- Description
- Show custom message when an error occurs
- Show app and profile installation progress
- Show error when installation takes longer than specified number of minutes
- Allow users to collect logs about installation errors
- Block device use until all apps and profiles are installed
- Allow users to reset device if installation error occurs
- Allow users to use device if installation error occurs
How to use it ?
Type Set-EnrollmentStatusPage with the ID of the page.
See below more examples:
Cmdlet in action
See below Enrollment Status Page options from the Intune portal before changes.

We will change some options, as below
- Description: This is a testing page
- Custom message: Oops !!! Houston we have a problem !!!
See below the cmdlet in action:

See below page option from Intune after the modification: 
Now we will change the Timeout error to 20 minutes and set the setting "Block device use until all apps and profiles are installed" to No.

See below the result:

What's next ?
I'm currently building a WPF tool to manage all those parts in a GUI.

Share this

Related Posts

Previous
Next Post »