Block Extension Loading via Group Policy (GPO)
This guide provides instructions for Windows System Administrators on how to restrict and completely block the discovery, loading, and execution of JavaScript extensions in PowerDocs across enterprise endpoints.
1. Overview
PowerDocs features an extensible JavaScript engine (powered by Jint) that allows users to add custom document templates, custom Markdown blocks (such as API definitions or callouts), and selection menu actions from local directories (%LocalAppData%\PowerDocs\extensions).
In corporate and high-security environments, running unvetted scripts or user-installed extensions may conflict with organizational security policies, Zero Trust architectures, or software restriction mandates.
To enforce strict endpoint governance:
- PowerDocs includes enterprise Group Policy hooks in
EntrepriseGpoService. - When the policy is enforced, the extension manager (
ExtensionManagerService.LoadAllExtensions()andLoadExtension()) unconditionally halts discovery and execution. - The JavaScript engine is never initialized, and no custom extension blocks, templates, or hooks are registered into the application or the PDF generation pipeline.
- PowerDocs logs an informational message indicating that extensions were blocked by Group Policy.
2. Windows Registry Specification
PowerDocs queries the Windows Registry during application startup (App.OnFrameworkInitializationCompleted) and whenever extensions are reloaded.
| Parameter | Specification |
|---|---|
| Supported Hives | HKEY_LOCAL_MACHINE (HKLM - Machine policy, priority) HKEY_CURRENT_USER (HKCU - User policy fallback) |
| Primary Registry Path | SOFTWARE\Policies\Coho\PowerDocs |
| Secondary Fallback Path | SOFTWARE\Policies\PowerDocs |
| Value Name | BlockExtensions (Alternative: DisableExtensions) |
| Value Type | REG_DWORD |
| Value Data | 1 = Completely block extension loading 0 = Allow extension loading (default) |
Note
Following standard Windows policy processing rules (see Microsoft Learn: Group Policy Architecture), values configured in HKEY_LOCAL_MACHINE supersede any user-level preferences in HKEY_CURRENT_USER.
PowerDocs also recognizes a registry subkey named BlockExtensions or DisableExtensions.
3. Deployment Methods
Method A: Group Policy Management Console (GPMC) — Group Policy Preferences
Using Group Policy Preferences (GPP) is the recommended method for Active Directory environments.
Tip
For detailed instructions on deploying registry keys using GPMC, refer to Microsoft Learn: Configure a Registry Item.
- Open Group Policy Management (
gpmc.msc) on your management server or domain controller. - Edit or create a Group Policy Object (GPO) linked to the target Computer Organizational Unit (OU).
- In the Group Policy Management Editor, navigate to:
- Computer Configuration > Preferences > Windows Settings > Registry.
- Right-click Registry > New > Registry Item, and configure:
- Action:
Update(orCreate) - Hive:
HKEY_LOCAL_MACHINE - Key Path:
SOFTWARE\Policies\Coho\PowerDocs - Value name:
BlockExtensions - Value type:
REG_DWORD - Value data:
1(Base: Decimal)
- Action:
- Save the policy and close the editor.
Method B: PowerShell Deployment
For scripted configuration, deployment via SCCM/MECM, or execution through RMM tooling:
# Define target registry policy path
$RegistryPath = "HKLM:\SOFTWARE\Policies\Coho\PowerDocs"
# Ensure the policy key path exists
if (-not (Test-Path -Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
# Enforce extension blocking (DWORD = 1)
Set-ItemProperty -Path $RegistryPath -Name "BlockExtensions" -Value 1 -Type DWord -Force
Write-Output "PowerDocs GPO policy 'BlockExtensions' successfully enabled at $RegistryPath."
(Reference: Microsoft Learn: Set-ItemProperty)
Method C: Registration File (.reg)
For local evaluation or manual application:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Coho\PowerDocs]
"BlockExtensions"=dword:00000001
Save as PowerDocs_BlockExtensions.reg and import with administrator privileges.
Method D: Microsoft Intune (Remediations)
In cloud-native or hybrid environments managed by Microsoft Intune, deploy the setting via Remediations (Proactive Remediations).
Tip
For guidance on creating and deploying Intune Remediations, see Microsoft Learn: Remediations in Microsoft Intune.
1. Detection Script (detect-block-extensions.ps1)
$path = "HKLM:\SOFTWARE\Policies\Coho\PowerDocs"
$name = "BlockExtensions"
if (Test-Path $path) {
$value = (Get-ItemProperty -Path $path -Name $name -ErrorAction SilentlyContinue).$name
if ($value -eq 1) {
Write-Output "PowerDocs extension blocking is enforced."
exit 0
}
}
Write-Output "PowerDocs extension blocking is not configured."
exit 1
2. Remediation Script (remediate-block-extensions.ps1)
$path = "HKLM:\SOFTWARE\Policies\Coho\PowerDocs"
$name = "BlockExtensions"
if (-not (Test-Path $path)) {
New-Item -Path $path -Force | Out-Null
}
Set-ItemProperty -Path $path -Name $name -Value 1 -Type DWord -Force
exit 0
4. Relationship with Application Control & Defense-in-Depth
Blocking extension loading in PowerDocs provides an essential defense-in-depth layer complementing operating system security mechanisms:
- Windows Defender Application Control (WDAC) & AppLocker: While WDAC and AppLocker govern executable binaries and PowerShell scripts (Microsoft Learn: WDAC Overview), in-app scripting engines (such as Jint in PowerDocs) run within the host application process. Enabling
BlockExtensionsensures that scripts cannot be executed within the PowerDocs sandbox regardless of file placement. - Attack Surface Reduction (ASR): Prevents users from installing unapproved third-party templates or automated Markdown transformations.
5. Verification & Diagnostics
Client-Side Validation
Trigger Group Policy refresh:
gpupdate /force(Reference: Microsoft Learn: gpupdate)
Verify applied policies using
gpresult:gpresult /r(Reference: Microsoft Learn: gpresult)
Check the Registry key:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Coho\PowerDocs" -Name "BlockExtensions"Expected output:
BlockExtensions : 1Verify in PowerDocs:
- Launch PowerDocs.
- Verify that no custom blocks (e.g. Swagger, DO/DON'T) or extension-based templates appear in the insert menus.
- In application logs (
%LocalAppData%\PowerDocs\logs\), verify the presence of:Le chargement des extensions a été bloqué par une stratégie de groupe d'entreprise (GPO).