Skip to content
AImori

Registry scripts and removal

For environments without GPO or Intune, for example via an RMM tool. The scripts are not part of the extension package; they are in the source code on GitHub in the enterprise/ folder (GitHub), the schema managed_schema.json in the extension/ folder. They run in Windows PowerShell 5.1 as administrator. Local scripts must be allowed by the execution policy (default on Windows Server: RemoteSigned); RMM tools and Intune run scripts themselves.

On this page
ScriptPurpose
Deploy-Policy.ps1 -ExtensionId lefajbhockjgdhaohnacgaggfepianjh -PolicyJson <file> [-Browser Edge,Chrome] [-UpdateUrl https://…]Write the policy; with -UpdateUrl additionally append one own forcelist entry at the next free number
Detect-Policy.ps1 -ExtensionId lefajbhockjgdhaohnacgaggfepianjh [-RequireForcelist]read only, exit 0/1
Remove-Policy.ps1 -ExtensionId lefajbhockjgdhaohnacgaggfepianjhremove its own policy key and its own forcelist entries

Dry run first

Review scripts before running them. -PlanOnly lists all planned registry values (no admin rights needed), -WhatIf shows what would change:

.\Deploy-Policy.ps1 -ExtensionId lefajbhockjgdhaohnacgaggfepianjh -PolicyJson .\example-policy.json -PlanOnly
.\Deploy-Policy.ps1 -ExtensionId lefajbhockjgdhaohnacgaggfepianjh -PolicyJson .\example-policy.json -WhatIf

Deploy-Policy.ps1 replaces the extension's whole policy key: copy partial samples such as example-ki-lenkung.json (steer users to an approved AI tool) into your own complete policy.

Safeguards of the scripts

  • Validation against managed_schema.json before every write.
  • Backup of previous values as .reg in a folder only administrators and SYSTEM can read (aborts on links or foreign ownership).
  • Other forcelist entries are never changed or deleted.

Registry format, as Chrome and Edge expect it for extension policies: object = subkey, list = subkey with values 1…n, true/false = REG_DWORD 0/1, text = REG_SZ.

Manual removal

Remove the extension in the browser (with forcelist, delete the entry first), then run Remove-Policy.ps1. The local counters disappear with the extension.

Free for Chrome