Select OCR language from a code page
Verified with Windows 11 25H2 — updated on July 10, 2026
Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
Path in the GPO console
Computer Configuration\Administrative Templates\Windows Components\Search\OCR Description
This policy setting allows selecting of OCR (Optical Character Recognition) languages that belong to one of the supported code pages. If you enable this policy setting, the selected OCR languages are used in OCR processing during the indexing of TIFF files. The default system language is ignored unless it is among the selected OCR languages. If you disable or do not configure this policy setting, only the default system language is used. All selected OCR languages must belong to the same code page. If you select languages from more than one code page, the entire OCR language selection is ignored and only the default system language is used. Re-indexing is not initiated when you enable this policy and selecting OCR languages. This policy setting only applies to the indexing of new files, unless re-indexing is initiated manually.
Registry
SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR Value name: SelectOCRLangs
Export Builder
BETAConfigure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.
These exports write the registry — this is not a managed GPO. ⓘ
.reg file
Windows Registry Editor Version 5.00
; Exported from gporais.com
; Policy: Select OCR language from a code page
; State: Enabled
; Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR]
"SelectOCRLangs"=dword:00000001
"Estonian"=dword:00000000
"Latvian"=dword:00000000
"Lithuanian"=dword:00000000
"Albanian"=dword:00000000
"Croatian"=dword:00000000
"Czech"=dword:00000000
"Hungarian"=dword:00000000
"Polish"=dword:00000000
"Romanian"=dword:00000000
"SerbianLatin"=dword:00000000
"Slovak"=dword:00000000
"Slovenian"=dword:00000000
"Bulgarian"=dword:00000000
"Byelorussian"=dword:00000000
"MacedoniaFYRO"=dword:00000000
"Russian"=dword:00000000
"Serbian"=dword:00000000
"Ukrainian"=dword:00000000
"Catalan"=dword:00000000
"Danish"=dword:00000000
"Dutch"=dword:00000000
"English"=dword:00000000
"Faroese"=dword:00000000
"Finnish"=dword:00000000
"French"=dword:00000000
"German"=dword:00000000
"Icelandic"=dword:00000000
"Indonesian"=dword:00000000
"Italian"=dword:00000000
"Malaysian"=dword:00000000
"Norwegian"=dword:00000000
"Portuguese"=dword:00000000
"Spanish"=dword:00000000
"Swedish"=dword:00000000
"Greek"=dword:00000000
"Turkish"=dword:00000000
"Chinese (Simplified)"=dword:00000000
"Chinese (Traditional)"=dword:00000000
"Japanese"=dword:00000000
"Korean"=dword:00000000 More formats (PowerShell, Intune, SCCM)
PowerShell
# Exported from gporais.com
# Policy: Select OCR language from a code page
# State: Enabled
# Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'SelectOCRLangs' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'Estonian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Latvian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Lithuanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Albanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Croatian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Czech' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Hungarian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Polish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Romanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'SerbianLatin' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Slovak' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Slovenian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Bulgarian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Byelorussian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'MacedoniaFYRO' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Russian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Serbian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Ukrainian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Catalan' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Danish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Dutch' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'English' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Faroese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Finnish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'French' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'German' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Icelandic' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Indonesian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Italian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Malaysian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Norwegian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Portuguese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Spanish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Swedish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Greek' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Turkish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Chinese (Simplified)' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Chinese (Traditional)' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Japanese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Korean' -Value 0 -Type DWord Intune XML
No direct Policy CSP / OMA-URI mapping for this policy. Use the Intune Remediation tab, or ingest the ADMX in Intune. Intune Remediation
# === Detection script ===
# Exported from gporais.com
# Policy: Select OCR language from a code page
# State: Enabled
# Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'SelectOCRLangs' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Estonian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Latvian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Lithuanian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Albanian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Croatian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Czech' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Hungarian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Polish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Romanian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'SerbianLatin' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Slovak' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Slovenian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Bulgarian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Byelorussian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'MacedoniaFYRO' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Russian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Serbian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Ukrainian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Catalan' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Danish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Dutch' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'English' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Faroese' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Finnish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'French' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'German' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Icelandic' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Indonesian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Italian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Malaysian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Norwegian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Portuguese' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Spanish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Swedish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Greek' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Turkish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Chinese (Simplified)' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Chinese (Traditional)' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Japanese' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Korean' -Expected 0 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Select OCR language from a code page
# State: Enabled
# Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'SelectOCRLangs' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'Estonian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Latvian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Lithuanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Albanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Croatian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Czech' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Hungarian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Polish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Romanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'SerbianLatin' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Slovak' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Slovenian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Bulgarian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Byelorussian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'MacedoniaFYRO' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Russian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Serbian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Ukrainian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Catalan' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Danish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Dutch' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'English' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Faroese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Finnish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'French' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'German' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Icelandic' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Indonesian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Italian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Malaysian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Norwegian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Portuguese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Spanish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Swedish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Greek' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Turkish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Chinese (Simplified)' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Chinese (Traditional)' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Japanese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Korean' -Value 0 -Type DWord SCCM scripts
# Exported from gporais.com
# Policy: Select OCR language from a code page
# State: Enabled
# Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
# SCCM Configuration Item guidance:
# Create a Configuration Item of type "Setting: Script".
# Discovery script: use the Detection script below.
# Remediation script: use the Remediation script below.
# Compliance rule: the Discovery script output equals 'Compliant'.
# === Detection script ===
# Exported from gporais.com
# Policy: Select OCR language from a code page
# State: Enabled
# Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'SelectOCRLangs' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Estonian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Latvian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Lithuanian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Albanian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Croatian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Czech' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Hungarian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Polish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Romanian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'SerbianLatin' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Slovak' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Slovenian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Bulgarian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Byelorussian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'MacedoniaFYRO' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Russian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Serbian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Ukrainian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Catalan' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Danish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Dutch' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'English' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Faroese' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Finnish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'French' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'German' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Icelandic' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Indonesian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Italian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Malaysian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Norwegian' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Portuguese' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Spanish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Swedish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Greek' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Turkish' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Chinese (Simplified)' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Chinese (Traditional)' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Japanese' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR' -Name 'Korean' -Expected 0 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Select OCR language from a code page
# State: Enabled
# Supported on: At least Windows 7 through Windows 8.1 or Windows Server 2012 R2
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search\OCR'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'SelectOCRLangs' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'Estonian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Latvian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Lithuanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Albanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Croatian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Czech' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Hungarian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Polish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Romanian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'SerbianLatin' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Slovak' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Slovenian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Bulgarian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Byelorussian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'MacedoniaFYRO' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Russian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Serbian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Ukrainian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Catalan' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Danish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Dutch' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'English' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Faroese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Finnish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'French' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'German' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Icelandic' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Indonesian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Italian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Malaysian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Norwegian' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Portuguese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Spanish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Swedish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Greek' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Turkish' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Chinese (Simplified)' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Chinese (Traditional)' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Japanese' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'Korean' -Value 0 -Type DWord Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.