I've been attempting to make new Autopilot profiles for a bunch of smaller tenants via MS Graph for PowerShell. When I use the command to create one, I get an error:
Code:
$body = [Microsoft.Graph.PowerShell.Models.MicrosoftGraphWindowsAutopilotDeploymentProfile]@{
DisplayName = "Test Profile"
Description = "Test Profile"
Language = 'En-AU'
ExtractHardwareHash = $false
EnableWhiteGlove = $true
DeviceNameTemplate = '%SERIAL%'
DeviceType = 'windowsPc'
RoleScopeTagIds = {0}
OutOfBoxExperienceSettings=@{
HidePrivacySettings = $true
HideEula = $true
UserType = 'Standard'
DeviceUsageType = 'singleuser'
SkipKeyboardSelectionPage = $false
HideEscapeLink = $true
}
EnrollmentStatusScreenSettings=@{
hideInstallationProgress = $true
allowDeviceUseBeforeProfileAndAppInstallComplete = $true
blockDeviceSetupRetryByUser = $false
allowLogCollectionOnInstallFailure = $true
customErrorMessage = "An error has occured. Please contact your IT Administrator"
installProgressTimeoutInMinutes = "45"
allowDeviceUseOnInstallFailure = $true
}
}
New-MgDeviceManagementWindowAutopilotDeploymentProfile -BodyParameter $body
Error:
New-MgDeviceManagementWindowAutopilotDeploymentProfile_Create:
Line |
29 | New-MgDeviceManagementWindowAutopilotDeploymentProfile -BodyParameter …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot create an abstract class.
Oddly, if I check [Microsoft.Graph.PowerShell.Models.MicrosoftGraphWindowsAutopilotDeploymentProfile], it's property "IsAbstract" is False.
I may be misunderstanding how to instantiate the object though. Is there anyone who can provide an example of how to complete this?