@@ -53,21 +53,24 @@ function Invoke-CIPPStandardAutopilotProfile {
5353 $DisplayName = Get-CIPPTextReplacement - Text $Settings.DisplayName - TenantFilter $Tenant
5454
5555 $CurrentConfig = New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles' - tenantid $Tenant |
56- Where-Object { $_.displayName -eq $DisplayName } |
57- Select-Object - Property displayName, description, deviceNameTemplate, language , enableWhiteGlove , extractHardwareHash , outOfBoxExperienceSetting, preprovisioningAllowed
56+ Where-Object { $_.displayName -eq $DisplayName } |
57+ Select-Object - Property displayName, description, deviceNameTemplate, locale , preprovisioningAllowed , hardwareHashExtractionEnabled , outOfBoxExperienceSetting
5858
5959 if ($Settings.NotLocalAdmin -eq $true ) { $userType = ' Standard' } else { $userType = ' Administrator' }
60- if ($Settings.SelfDeployingMode -eq $true ) { $DeploymentMode = ' shared' } else { $DeploymentMode = ' singleUser' }
61- if ($Settings.AllowWhiteGlove -eq $true ) { $Settings.HideChangeAccount = $true }
60+ if ($Settings.SelfDeployingMode -eq $true ) {
61+ $DeploymentMode = ' shared'
62+ $Setings.AllowWhiteGlove = $false
63+ } else {
64+ $DeploymentMode = ' singleUser'
65+ }
6266
6367 $StateIsCorrect = ($CurrentConfig.displayName -eq $DisplayName ) -and
6468 ($CurrentConfig.description -eq $Settings.Description ) -and
6569 ($CurrentConfig.deviceNameTemplate -eq $Settings.DeviceNameTemplate ) -and
66- ([string ]::IsNullOrWhiteSpace($CurrentConfig.language ) -and [string ]::IsNullOrWhiteSpace($Settings.Languages.value ) -or $CurrentConfig.language -eq $Settings.Languages.value ) -and
67- ($CurrentConfig.enableWhiteGlove -eq $Settings.AllowWhiteGlove ) -and
68- ($CurrentConfig.extractHardwareHash -eq $Settings.CollectHash ) -and
70+ ([string ]::IsNullOrWhiteSpace($CurrentConfig.locale ) -and [string ]::IsNullOrWhiteSpace($Settings.Languages.value ) -or $CurrentConfig.locale -eq $Settings.Languages.value ) -and
71+ ($CurrentConfig.preprovisioningAllowed -eq $Settings.AllowWhiteGlove ) -and
72+ ($CurrentConfig.hardwareHashExtractionEnabled -eq $Settings.CollectHash ) -and
6973 ($CurrentConfig.outOfBoxExperienceSetting.deviceUsageType -eq $DeploymentMode ) -and
70- ($CurrentConfig.outOfBoxExperienceSetting.escapeLinkHidden -eq $Settings.HideChangeAccount ) -and
7174 ($CurrentConfig.outOfBoxExperienceSetting.privacySettingsHidden -eq $Settings.HidePrivacy ) -and
7275 ($CurrentConfig.outOfBoxExperienceSetting.eulaHidden -eq $Settings.HideTerms ) -and
7376 ($CurrentConfig.outOfBoxExperienceSetting.userType -eq $userType ) -and
@@ -94,7 +97,7 @@ function Invoke-CIPPStandardAutopilotProfile {
9497 devicenameTemplate = $Settings.DeviceNameTemplate
9598 allowWhiteGlove = $Settings.AllowWhiteGlove
9699 CollectHash = $Settings.CollectHash
97- hideChangeAccount = $Settings .HideChangeAccount
100+ hideChangeAccount = $true
98101 hidePrivacy = $Settings.HidePrivacy
99102 hideTerms = $Settings.HideTerms
100103 AutoKeyboard = $Settings.AutoKeyboard
0 commit comments