Skip to content

Commit 07abb10

Browse files
Merge pull request KelvinTegelaar#1628 from PeterVive/whfb-enrollment-configuration
Add standard for configuring WHFB enrollment configuration - FR #4698
2 parents 48d447d + 5e5e044 commit 07abb10

File tree

2 files changed

+300
-0
lines changed

2 files changed

+300
-0
lines changed

Config/standards.json

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,6 +3428,163 @@
34283428
"addedDate": "2025-04-01",
34293429
"powershellEquivalent": "Graph API",
34303430
"recommendedBy": []
3431+
},
3432+
{
3433+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration",
3434+
"cat": "Intune Standards",
3435+
"tag": [],
3436+
"helpText": "Sets the Windows Hello for Business configuration during device enrollment.",
3437+
"executiveText": "Enables or disables Windows Hello for Business during device enrollment, enhancing security through biometric or PIN-based authentication methods. This ensures that devices meet corporate security standards while providing a user-friendly sign-in experience.",
3438+
"addedComponent": [
3439+
{
3440+
"type": "autoComplete",
3441+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.state",
3442+
"label": "Configure Windows Hello for Business",
3443+
"multiple": false,
3444+
"options": [
3445+
{
3446+
"label": "Not configured",
3447+
"value": "notConfigured"
3448+
},
3449+
{
3450+
"label": "Enabled",
3451+
"value": "enabled"
3452+
},
3453+
{
3454+
"label": "Disabled",
3455+
"value": "disabled"
3456+
}
3457+
]
3458+
},
3459+
{
3460+
"type": "switch",
3461+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.securityDeviceRequired",
3462+
"label": "Use a Trusted Platform Module (TPM)",
3463+
"default": true
3464+
},
3465+
{
3466+
"type": "number",
3467+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinMinimumLength",
3468+
"label": "Minimum PIN length (4-127)",
3469+
"default": 4
3470+
},
3471+
{
3472+
"type": "number",
3473+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinMaximumLength",
3474+
"label": "Maximum PIN length (4-127)",
3475+
"default": 127
3476+
},
3477+
{
3478+
"type": "autoComplete",
3479+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinLowercaseCharactersUsage",
3480+
"label": "Lowercase letters in PIN",
3481+
"multiple": false,
3482+
"options": [
3483+
{
3484+
"label": "Not allowed",
3485+
"value": "disallowed"
3486+
},
3487+
{
3488+
"label": "Allowed",
3489+
"value": "allowed"
3490+
},
3491+
{
3492+
"label": "Required",
3493+
"value": "required"
3494+
}
3495+
]
3496+
},
3497+
{
3498+
"type": "autoComplete",
3499+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinUppercaseCharactersUsage",
3500+
"label": "Uppercase letters in PIN",
3501+
"multiple": false,
3502+
"options": [
3503+
{
3504+
"label": "Not allowed",
3505+
"value": "disallowed"
3506+
},
3507+
{
3508+
"label": "Allowed",
3509+
"value": "allowed"
3510+
},
3511+
{
3512+
"label": "Required",
3513+
"value": "required"
3514+
}
3515+
]
3516+
},
3517+
{
3518+
"type": "autoComplete",
3519+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinSpecialCharactersUsage",
3520+
"label": "Special characters in PIN",
3521+
"multiple": false,
3522+
"options": [
3523+
{
3524+
"label": "Not allowed",
3525+
"value": "disallowed"
3526+
},
3527+
{
3528+
"label": "Allowed",
3529+
"value": "allowed"
3530+
},
3531+
{
3532+
"label": "Required",
3533+
"value": "required"
3534+
}
3535+
]
3536+
},
3537+
{
3538+
"type": "number",
3539+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinExpirationInDays",
3540+
"label": "PIN expiration (days) - 0 to disable",
3541+
"default": 0
3542+
},
3543+
{
3544+
"type": "number",
3545+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.pinPreviousBlockCount",
3546+
"label": "PIN history - 0 to disable",
3547+
"default": 0
3548+
},
3549+
{
3550+
"type": "switch",
3551+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.unlockWithBiometricsEnabled",
3552+
"label": "Allow biometric authentication",
3553+
"default": true
3554+
},
3555+
{
3556+
"type": "autoComplete",
3557+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.enhancedBiometricsState",
3558+
"label": "Use enhanced anti-spoofing when available",
3559+
"multiple": false,
3560+
"options": [
3561+
{
3562+
"label": "Not configured",
3563+
"value": "notConfigured"
3564+
},
3565+
{
3566+
"label": "Enabled",
3567+
"value": "enabled"
3568+
},
3569+
{
3570+
"label": "Disabled",
3571+
"value": "disabled"
3572+
}
3573+
]
3574+
},
3575+
{
3576+
"type": "switch",
3577+
"name": "standards.EnrollmentWindowsHelloForBusinessConfiguration.remotePassportEnabled",
3578+
"label": "Allow phone sign-in",
3579+
"default": true
3580+
}
3581+
],
3582+
"label": "Windows Hello for Business enrollment configuration",
3583+
"impact": "Low Impact",
3584+
"impactColour": "info",
3585+
"addedDate": "2025-09-25",
3586+
"powershellEquivalent": "Graph API",
3587+
"recommendedBy": []
34313588
},
34323589
{
34333590
"name": "standards.intuneDeviceReg",
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
function Invoke-CIPPStandardEnrollmentWindowsHelloForBusinessConfiguration {
2+
<#
3+
.FUNCTIONALITY
4+
Internal
5+
.COMPONENT
6+
(APIName) EnrollmentWindowsHelloForBusinessConfiguration
7+
.SYNOPSIS
8+
(Label) Windows Hello for Business enrollment configuration
9+
.DESCRIPTION
10+
(Helptext) Sets the Windows Hello for Business configuration during device enrollment.
11+
(DocsDescription) Sets the Windows Hello for Business configuration during device enrollment.
12+
.NOTES
13+
CAT
14+
Intune Standards
15+
TAG
16+
EXECUTIVETEXT
17+
Enables or disables Windows Hello for Business during device enrollment, enhancing security through biometric or PIN-based authentication methods. This ensures that devices meet corporate security standards while providing a user-friendly sign-in experience.
18+
ADDEDCOMPONENT
19+
{"type":"autoComplete","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.state","label":"Configure Windows Hello for Business","multiple":false,"options":[{"label":"Not configured","value":"notConfigured"},{"label":"Enabled","value":"enabled"},{"label":"Disabled","value":"disabled"}]}
20+
{"type":"switch","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.securityDeviceRequired","label":"Use a Trusted Platform Module (TPM)","default":true}
21+
{"type":"number","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinMinimumLength","label":"Minimum PIN length (4-127)","default":4}
22+
{"type":"number","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinMaximumLength","label":"Maximum PIN length (4-127)","default":127}
23+
{"type":"autoComplete","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinLowercaseCharactersUsage","label":"Lowercase letters in PIN","multiple":false,"options":[{"label":"Not allowed","value":"disallowed"},{"label":"Allowed","value":"allowed"},{"label":"Required","value":"required"}]}
24+
{"type":"autoComplete","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinUppercaseCharactersUsage","label":"Uppercase letters in PIN","multiple":false,"options":[{"label":"Not allowed","value":"disallowed"},{"label":"Allowed","value":"allowed"},{"label":"Required","value":"required"}]}
25+
{"type":"autoComplete","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinSpecialCharactersUsage","label":"Special characters in PIN","multiple":false,"options":[{"label":"Not allowed","value":"disallowed"},{"label":"Allowed","value":"allowed"},{"label":"Required","value":"required"}]}
26+
{"type":"number","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinExpirationInDays","label":"PIN expiration (days) - 0 to disable","default":"0"}
27+
{"type":"number","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.pinPreviousBlockCount","label":"PIN history - 0 to disable","default":"0"}
28+
{"type":"switch","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.unlockWithBiometricsEnabled","label":"Allow biometric authentication","default":true}
29+
{"type":"autoComplete","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.enhancedBiometricsState","label":"Use enhanced anti-spoofing when available","multiple":false,"options":[{"label":"Not configured","value":"notConfigured"},{"label":"Enabled","value":"enabled"},{"label":"Disabled","value":"disabled"}]}
30+
{"type":"switch","name":"standards.EnrollmentWindowsHelloForBusinessConfiguration.remotePassportEnabled","label":"Allow phone sign-in","default":true}
31+
IMPACT
32+
Low Impact
33+
ADDEDDATE
34+
2025-09-25
35+
POWERSHELLEQUIVALENT
36+
Graph API
37+
RECOMMENDEDBY
38+
UPDATECOMMENTBLOCK
39+
Run the Tools\Update-StandardsComments.ps1 script to update this comment block
40+
.LINK
41+
https://docs.cipp.app/user-documentation/tenant/standards/list-standards
42+
#>
43+
44+
param($Tenant, $Settings)
45+
$TestResult = Test-CIPPStandardLicense -StandardName 'EnrollmentWindowsHelloForBusinessConfiguration' -TenantFilter $Tenant -RequiredCapabilities @('INTUNE_A', 'MDM_Services', 'EMS', 'SCCM', 'MICROSOFTINTUNEPLAN1')
46+
47+
if ($TestResult -eq $false) {
48+
Write-Host "We're exiting as the correct license is not present for this standard."
49+
return $true
50+
} #we're done.
51+
52+
try {
53+
$CurrentState = New-GraphGetRequest -Uri "https://graph.microsoft.com/beta/deviceManagement/deviceEnrollmentConfigurations?`$expand=assignments&orderBy=priority&`$filter=deviceEnrollmentConfigurationType eq 'WindowsHelloForBusiness'" -tenantID $Tenant -AsApp $true |
54+
Select-Object -Property id, pinMinimumLength, pinMaximumLength, pinUppercaseCharactersUsage, pinLowercaseCharactersUsage, pinSpecialCharactersUsage, state, securityDeviceRequired, unlockWithBiometricsEnabled, remotePassportEnabled, pinPreviousBlockCount, pinExpirationInDays, enhancedBiometricsState
55+
}
56+
catch {
57+
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message
58+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message "Could not get the EnrollmentWindowsHelloForBusinessConfiguration state for $Tenant. Error: $ErrorMessage" -Sev Error
59+
return
60+
}
61+
62+
$StateIsCorrect = ($CurrentState.pinMinimumLength -eq $Settings.pinMinimumLength) -and
63+
($CurrentState.pinMaximumLength -eq $Settings.pinMaximumLength) -and
64+
($CurrentState.pinUppercaseCharactersUsage -eq $Settings.pinUppercaseCharactersUsage.value) -and
65+
($CurrentState.pinLowercaseCharactersUsage -eq $Settings.pinLowercaseCharactersUsage.value) -and
66+
($CurrentState.pinSpecialCharactersUsage -eq $Settings.pinSpecialCharactersUsage.value) -and
67+
($CurrentState.state -eq $Settings.state.value) -and
68+
($CurrentState.securityDeviceRequired -eq $Settings.securityDeviceRequired) -and
69+
($CurrentState.unlockWithBiometricsEnabled -eq $Settings.unlockWithBiometricsEnabled) -and
70+
($CurrentState.remotePassportEnabled -eq $Settings.remotePassportEnabled) -and
71+
($CurrentState.pinPreviousBlockCount -eq $Settings.pinPreviousBlockCount) -and
72+
($CurrentState.pinExpirationInDays -eq $Settings.pinExpirationInDays) -and
73+
($CurrentState.enhancedBiometricsState -eq $Settings.enhancedBiometricsState.value)
74+
75+
$CompareField = [PSCustomObject]@{
76+
pinMinimumLength = $CurrentState.pinMinimumLength
77+
pinMaximumLength = $CurrentState.pinMaximumLength
78+
pinUppercaseCharactersUsage = $CurrentState.pinUppercaseCharactersUsage
79+
pinLowercaseCharactersUsage = $CurrentState.pinLowercaseCharactersUsage
80+
pinSpecialCharactersUsage = $CurrentState.pinSpecialCharactersUsage
81+
state = $CurrentState.state
82+
securityDeviceRequired = $CurrentState.securityDeviceRequired
83+
unlockWithBiometricsEnabled = $CurrentState.unlockWithBiometricsEnabled
84+
remotePassportEnabled = $CurrentState.remotePassportEnabled
85+
pinPreviousBlockCount = $CurrentState.pinPreviousBlockCount
86+
pinExpirationInDays = $CurrentState.pinExpirationInDays
87+
enhancedBiometricsState = $CurrentState.enhancedBiometricsState
88+
}
89+
90+
If ($Settings.remediate -eq $true) {
91+
if ($StateIsCorrect -eq $true) {
92+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'EnrollmentWindowsHelloForBusinessConfiguration is already applied correctly.' -Sev Info
93+
}
94+
else {
95+
$cmdParam = @{
96+
tenantid = $Tenant
97+
uri = "https://graph.microsoft.com/beta/deviceManagement/deviceEnrollmentConfigurations/$($CurrentState.id)"
98+
AsApp = $false
99+
Type = 'PATCH'
100+
ContentType = 'application/json; charset=utf-8'
101+
Body = [PSCustomObject]@{
102+
"@odata.type" = "#microsoft.graph.deviceEnrollmentWindowsHelloForBusinessConfiguration"
103+
pinMinimumLength = $Settings.pinMinimumLength
104+
pinMaximumLength = $Settings.pinMaximumLength
105+
pinUppercaseCharactersUsage = $Settings.pinUppercaseCharactersUsage.value
106+
pinLowercaseCharactersUsage = $Settings.pinLowercaseCharactersUsage.value
107+
pinSpecialCharactersUsage = $Settings.pinSpecialCharactersUsage.value
108+
state = $Settings.state.value
109+
securityDeviceRequired = $Settings.securityDeviceRequired
110+
unlockWithBiometricsEnabled = $Settings.unlockWithBiometricsEnabled
111+
remotePassportEnabled = $Settings.remotePassportEnabled
112+
pinPreviousBlockCount = $Settings.pinPreviousBlockCount
113+
pinExpirationInDays = $Settings.pinExpirationInDays
114+
enhancedBiometricsState = $Settings.enhancedBiometricsState.value
115+
} | ConvertTo-Json -Compress -Depth 10
116+
}
117+
try {
118+
$null = New-GraphPostRequest @cmdParam
119+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'Successfully updated EnrollmentWindowsHelloForBusinessConfiguration.' -Sev Info
120+
}
121+
catch {
122+
$ErrorMessage = Get-CippException -Exception $_
123+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message "Failed to update EnrollmentWindowsHelloForBusinessConfiguration. Error: $($ErrorMessage.NormalizedError)" -Sev Error
124+
}
125+
}
126+
127+
}
128+
129+
If ($Settings.alert -eq $true) {
130+
if ($StateIsCorrect -eq $true) {
131+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'EnrollmentWindowsHelloForBusinessConfiguration is correctly set.' -Sev Info
132+
}
133+
else {
134+
Write-StandardsAlert -message 'EnrollmentWindowsHelloForBusinessConfiguration is incorrectly set.' -object $CompareField -tenant $Tenant -standardName 'EnrollmentWindowsHelloForBusinessConfiguration' -standardId $Settings.standardId
135+
Write-LogMessage -API 'Standards' -Tenant $Tenant -Message 'EnrollmentWindowsHelloForBusinessConfiguration is incorrectly set.' -Sev Info
136+
}
137+
}
138+
139+
If ($Settings.report -eq $true) {
140+
$FieldValue = $StateIsCorrect ? $true : $CompareField
141+
Set-CIPPStandardsCompareField -FieldName 'standards.EnrollmentWindowsHelloForBusinessConfiguration' -FieldValue $FieldValue -TenantFilter $Tenant
142+
}
143+
}

0 commit comments

Comments
 (0)