---
title: FAQ - Certificate Purpose and EKU Testing Scenarios
description: "Test Certificate Purpose and EKU validation with automated PowerShell scripts covering 6 scenarios: Server Auth, Client Auth, Code Signing, Multi-Purpose, Any Purpose, and Missing EKU."
---

# FAQ - Certificate Purpose and EKU Testing Scenarios

Validate [Certificate Purpose and EKU][] monitoring with automated PowerShell test scripts covering all detection scenarios - from properly scoped single-purpose certificates (OK) to security risks like "Any Purpose" certificates (ERROR) and multi-purpose configurations (WARNING).

**What's on This Page:**

* **6 Test Scenarios** - Config tables and validation points for Server Auth, Client Auth, [Code Signing][], Multi-Purpose, Any Purpose, and Missing EKU
* [Batch Testing Script][] - Create all test certificates with a signed Root CA for chain validation
* [Cleanup and Diagnostic Script][] - Remove test certificates and diagnose leftover artifacts
* **Validation Checklist** - Verify expected monitoring states match actual results
* **Troubleshooting** - Resolve testing-specific issues (agent detection, configuration, PowerShell errors)

## Why Test Certificate Purpose?

Certificate purpose validation prevents security risks from overly permissive certificates. Testing ensures monitoring correctly identifies:

* ❌ **Any Purpose certificates** (ERROR) - Can be used for ANY operation if compromised
* ⚠️ **Multi-purpose certificates** (WARNING) - Broader attack surface than needed
* ⚠️ **Missing Key Usage** (WARNING) - Unclear purpose, potential compatibility issues
* ✅ **Single-purpose certificates** (OK) - Properly scoped, follows least privilege

**Related Documentation:** See [Certificate Purpose and EKU][] for complete feature documentation, security context, detection examples, and best practices.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>These scripts require <strong>PowerShell 7+</strong> with Administrator privileges for certificate store access.</p></div>
</aside>

<aside aria-label="Warning" class="nodinite-note nodinite-note--warning">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-triangle-exclamation"></i> Warning</p>
<div class="nodinite-note__content"><p>Never deploy test certificates to production environments. Always clean up after validation testing.</p></div>
</aside>

![Certificate Purpose Validation Example][1]  
*Certificate purpose validation showing Enhanced Key Usage extensions and security assessment results.*

## <i class="fal fa-list-check" aria-hidden="true"></i> Testing Scenarios Overview

|#|Scenario|Purpose|[Expected State][]|Key Focus|
|---|---|---|---|---|
|**1**|[Server Authentication](#scenario-1-server-authentication)|SSL/TLS server certificates|✅ **OK**|Server Auth EKU (1.3.6.1.5.5.7.3.1)|
|**2**|[Client Authentication](#scenario-2-client-authentication)|Client auth & mTLS|✅ **OK**|Client Auth EKU (1.3.6.1.5.5.7.3.2)|
|**3**|[Code Signing](#scenario-3-code-signing)|Software & script signing|✅ **OK**|Code Signing EKU (1.3.6.1.5.5.7.3.3)|
|**4**|[Multi-Purpose](#scenario-4-multi-purpose)|Multiple EKUs (broader scope)|⚠️ **Warning**|Server + Client Auth combined|
|**5**|[Any Purpose](#scenario-5-any-purpose-security-risk)|Overly permissive certificate|❌ **Critical**|Any Purpose EKU (2.5.29.37.0)|
|**6**|[Missing EKU](#scenario-6-missing-eku)|No Extended Key Usage extension|⚠️ **Warning**|No EKU extension defined|

## <i class="fal fa-sitemap" aria-hidden="true"></i> Test Scenario Workflow

```mermaid
graph TD
    Start[Start Testing] --> Config[Configure Scenarios]
    Config --> S1{Scenario 1 Server Auth}
    Config --> S2{Scenario 2 Client Auth}
    Config --> S3{Scenario 3 Code Signing}
    Config --> S4{Scenario 4 Multi-Purpose}
    Config --> S5{Scenario 5 Any Purpose}
    Config --> S6{Scenario 6 Missing EKU}
    S1 --> V1[OK]
    S2 --> V2[OK]
    S3 --> V3[OK]
    S4 --> V4[Warning]
    S5 --> V5[Critical]
    S6 --> V6[Warning]
    V1 --> Monitor[Monitor Results]
    V2 --> Monitor
    V3 --> Monitor
    V4 --> Monitor
    V5 --> Monitor
    V6 --> Monitor
    Monitor --> Validate[Validate Alerts]
    Validate --> Cleanup[Cleanup Test Certs]
    Cleanup --> End[Testing Complete]
    style S1 fill:#e3f2fd
    style S2 fill:#e3f2fd
    style S3 fill:#e3f2fd
    style S4 fill:#fff3e0
    style S5 fill:#ffebee
    style S6 fill:#fff3e0
    style V1 fill:#c8e6c9
    style V2 fill:#c8e6c9
    style V3 fill:#c8e6c9
    style V4 fill:#ffe0b2
    style V5 fill:#ffcdd2
    style V6 fill:#ffe0b2
```

*Diagram: Full testing workflow from scenario configuration through certificate creation, monitoring validation, and cleanup.*

## <i class="fal fa-vial" aria-hidden="true"></i> Test Scenarios

### Scenario 1: Server Authentication

**Purpose**: Validate SSL/TLS server certificate monitoring with proper Server Authentication EKU.

|Setting|Value|Rationale|
|---|---|---|
|<i class="fal fa-certificate" aria-hidden="true"></i> **EKU**|Server Authentication (1.3.6.1.5.5.7.3.1)|Single-purpose EKU for HTTPS/TLS servers - follows least privilege principle|
|<i class="fal fa-key" aria-hidden="true"></i> **Key Usage**|DigitalSignature, KeyEncipherment|Required for SSL/TLS handshake and session key encryption|
|<i class="fal fa-box-archive" aria-hidden="true"></i> **Store**|Local Machine|Server certificates must be accessible to [IIS][]/services running under system accounts|
|<i class="fal fa-traffic-light" aria-hidden="true"></i> [Expected State][]|✅ OK|Properly scoped certificate should pass validation without warnings|

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p><strong>Using certificates with IBM MQ?</strong> IBM MQ has version-specific certificate storage: legacy agents (.NET Framework 4.8) use IBM MQ Key Database files (.kdb), while modern agents (.NET 9/10) support Windows Certificate Store. See <a href="https://docs.nodinite.com/logging-and-monitoring/ibm-mq/troubleshooting/faq-ssl-certificate-configuration/">IBM MQ SSL FAQ</a> for conversion guidance.</p></div>
</aside>

**Validation Points:**

* Server Auth EKU present and validated
* Appropriate for IIS bindings, API endpoints, HTTPS services
* No security warnings for properly scoped certificate

---

### Scenario 2: Client Authentication

**Purpose**: Test client authentication certificate validation for mTLS and client auth scenarios.

|Setting|Value|Rationale|
|---|---|---|
|<i class="fal fa-certificate" aria-hidden="true"></i> **EKU**|Client Authentication (1.3.6.1.5.5.7.3.2)|Single-purpose EKU for client-side authentication (mTLS, VPN, smart cards)|
|<i class="fal fa-key" aria-hidden="true"></i> **Key Usage**|DigitalSignature|Client certificates only need to sign authentication challenges|
|<i class="fal fa-box-archive" aria-hidden="true"></i> **Store**|Local Machine|All test certificates installed in LocalMachine\My for consistency|
|<i class="fal fa-traffic-light" aria-hidden="true"></i> [Expected State][]|✅ OK|Properly scoped client certificate should pass validation|

**Validation Points:**

* Client Auth EKU properly configured
* Suitable for mutual TLS, VPN client auth, smart card authentication
* Single-purpose certificate with appropriate scope

---

### Scenario 3: Code Signing

**Purpose**: Verify code signing certificate purpose validation.

|Setting|Value|Rationale|
|---|---|---|
|<i class="fal fa-certificate" aria-hidden="true"></i> **EKU**|Code Signing (1.3.6.1.5.5.7.3.3)|Single-purpose EKU for signing executables, scripts, and software packages|
|<i class="fal fa-key" aria-hidden="true"></i> **Key Usage**|DigitalSignature|Code signing only requires ability to create digital signatures|
|<i class="fal fa-box-archive" aria-hidden="true"></i> **Store**|Local Machine|Shared code signing certificates accessible to build servers and deployment systems|
|<i class="fal fa-traffic-light" aria-hidden="true"></i> [Expected State][]|✅ OK|Purpose-specific code signing certificate should validate successfully|

**Validation Points:**

* Code Signing EKU validated
* Appropriate for PowerShell scripts, executables, MSI packages
* Private key protection critical for code integrity

---

### Scenario 4: Multi-Purpose

**Purpose**: Test detection of certificates with multiple EKU extensions (security concern).

|Setting|Value|Rationale|
|---|---|---|
|<i class="fal fa-certificate" aria-hidden="true"></i> **EKU**|Server Authentication + Client Authentication|Multiple EKUs create broader attack surface - violates least privilege|
|<i class="fal fa-key" aria-hidden="true"></i> **Key Usage**|DigitalSignature, KeyEncipherment|Combined usage for both server and client operations|
|<i class="fal fa-box-archive" aria-hidden="true"></i> **Store**|Local Machine|System-wide store to demonstrate improper multi-purpose certificate deployment|
|<i class="fal fa-traffic-light" aria-hidden="true"></i> [Expected State][]|⚠️ Warning|Should trigger warning for overly permissive certificate scope|

**Validation Points:**

* Multiple EKUs detected (broader attack surface)
* Warning generated for multi-purpose usage
* Violates principle of least privilege

---

### Scenario 5: Any Purpose (Security Risk)

**Purpose**: Detect overly permissive "Any Purpose" certificates (critical security risk).

|Setting|Value|Rationale|
|---|---|---|
|<i class="fal fa-certificate" aria-hidden="true"></i> **EKU**|Any Purpose (2.5.29.37.0)|Unrestricted usage - can be used for ANY operation if compromised (maximum risk)|
|<i class="fal fa-key" aria-hidden="true"></i> **Key Usage**|DigitalSignature, KeyEncipherment|Standard key usage combined with Any Purpose EKU creates security risk|
|<i class="fal fa-box-archive" aria-hidden="true"></i> **Store**|Local Machine|System-wide to demonstrate critical risk of "Any Purpose" in production|
|<i class="fal fa-traffic-light" aria-hidden="true"></i> [Expected State][]|❌ Critical|Must trigger critical error for immediate remediation|

**Validation Points:**

* Any Purpose EKU (OID 2.5.29.37.0) flagged as critical security risk
* Unrestricted usage enables maximum attack surface
* Immediate remediation required (replace with purpose-specific certificate)

---

### Scenario 6: Missing EKU

**Purpose**: Identify certificates without explicit Enhanced Key Usage (EKU) extensions.

|Setting|Value|Rationale|
|---|---|---|
|<i class="fal fa-certificate" aria-hidden="true"></i> **EKU**|Not defined|Missing EKU makes certificate purpose unclear and unpredictable|
|<i class="fal fa-key" aria-hidden="true"></i> **Key Usage**|Default (PowerShell adds automatically)|PowerShell adds default Key Usage; omitting EKU creates undefined purpose|
|<i class="fal fa-box-archive" aria-hidden="true"></i> **Store**|Local Machine|System-wide store to test detection of incomplete certificate definitions|
|<i class="fal fa-traffic-light" aria-hidden="true"></i> [Expected State][]|⚠️ Warning|Should trigger warning for undefined EKU - requires manual review|

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>PowerShell's <code>New-SelfSignedCertificate</code> cmdlet <strong>always adds default Key Usage</strong> values even when not specified. This scenario omits the <code>-TextExtension</code> parameter to create a certificate <strong>without an EKU extension</strong>. To create a certificate that truly lacks both Key Usage AND EKU extensions, use <code>certreq.exe</code> with a custom INF file that explicitly omits both extensions.</p></div>
</aside>

**Validation Points:**

* Missing EKU extension detected
* Warning for undefined certificate purpose
* Requires manual review to determine intended usage

---

## <i class="fal fa-tools" aria-hidden="true"></i> Batch Testing Script

The [Batch Testing Script][] creates all 6 test scenarios in a single run, including a signed test Root CA for chain validation compatibility.

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p><strong>Chain Validation Compatible</strong>: The batch script creates a test Root CA installed to the Trusted Root store so chain validation passes automatically — no need to disable chain validation or enable dev mode.</p></div>
</aside>

**What the script does:**

* Creates a test Root CA signed by itself (installed to `LocalMachine\Root`)
* Issues all 6 test certificates signed by the test Root CA
* Outputs a summary with thumbprint and expected monitoring state per certificate

[→ View Full Batch Testing Script][Batch Testing Script]

---

## <i class="fal fa-broom" aria-hidden="true"></i> Cleanup Script

The [Cleanup and Diagnostic Script][] removes all test certificates and the test Root CA after validation.

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>The cleanup script removes <strong>both</strong> the 6 test certificates (from <code>LocalMachine\My</code>) <strong>and</strong> the Nodinite Test Root CA (from <code>LocalMachine\Root</code>).</p></div>
</aside>

[→ View Full Cleanup and Diagnostic Script][Cleanup and Diagnostic Script]

---

## <i class="fal fa-play" aria-hidden="true"></i> Usage Instructions

### Running the Batch Script

1. <i class="fal fa-terminal" aria-hidden="true"></i> **Open PowerShell 7 as Administrator** and verify version: `$PSVersionTable.PSVersion`

2. <i class="fal fa-wrench" aria-hidden="true"></i> **Configure Scenarios** (optional): Edit the `$scenarios` hashtable to enable/disable specific tests

3. <i class="fal fa-play" aria-hidden="true"></i> **Execute** the script from [Batch Testing Script][]

4. <i class="fal fa-desktop" aria-hidden="true"></i> **Monitor Results**: Wait for agent discovery (or force sync), then verify expected states match actual monitoring results

5. <i class="fal fa-broom" aria-hidden="true"></i> **Cleanup**: Run the [Cleanup and Diagnostic Script][] when testing is complete

### Validation Checklist

* <i class="fal fa-square" aria-hidden="true"></i> ✅ **Chain validation passes** (all certs trusted via test Root CA)
* <i class="fal fa-square" aria-hidden="true"></i> ✅ Server Authentication shows OK state
* <i class="fal fa-square" aria-hidden="true"></i> ✅ Client Authentication shows OK state
* <i class="fal fa-square" aria-hidden="true"></i> ✅ Code Signing shows OK state
* <i class="fal fa-square" aria-hidden="true"></i> ⚠️ Multi-Purpose generates Warning alert
* <i class="fal fa-square" aria-hidden="true"></i> ❌ Any Purpose generates Critical alert
* <i class="fal fa-square" aria-hidden="true"></i> ⚠️ Missing EKU generates Warning alert

---

## <i class="fal fa-question-circle" aria-hidden="true"></i> Frequently Asked Questions

**Q: Why do I get script errors when running the PowerShell 7 test scripts?**  
**A:** These scripts require **PowerShell 7 or later** with Administrator privileges. Verify your PowerShell version by running `$PSVersionTable.PSVersion` — it should show 7.x or higher. PowerShell 5.1 (Windows PowerShell) does not support the `-TextExtension` parameter used for configuring Enhanced Key Usage extensions. Download PowerShell 7+ from [Microsoft's official site](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-windows)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

**Q: Will these test certificates trigger chain validation errors?**  
**A:** **No** — the batch script creates a test Root CA and automatically installs it to the Trusted Root Certification Authorities store. All 6 test certificates are signed by this CA, ensuring **chain validation passes**. The [Cleanup and Diagnostic Script][] removes both the test certificates and the Root CA.

**Q: How do I validate Certificate Purpose and EKU usage with <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>?**  
**A:** Run the [Batch Testing Script][] on your [Windows Server][] to create test certificates with different EKU configurations. The <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> monitoring agent will automatically discover these certificates during its next synchronization cycle. Review monitoring results in the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Web Client][] to verify each certificate shows the expected state.

**Q: How do I enable Certificate Purpose and EKU validation in <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>?**  
**A:** Enable the "Validate Certificate Purpose" feature in the [Windows Server Monitoring Agent][] configuration. See the [Certificate Configuration][] guide for step-by-step instructions.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-cog" aria-hidden="true"></i> [Certificate Configuration][] – Turn on certificate purpose checks  
* <i class="fal fa-tools" aria-hidden="true"></i> [Batch Testing Script][] – Create the test certificates for these scenarios  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-shield-check" aria-hidden="true"></i> [Certificate Overview][]  
* <i class="fal fa-chart-line" aria-hidden="true"></i> [Certificate Monitoring][]  
* <i class="fal fa-certificate" aria-hidden="true"></i> [Certificate Purpose and EKU][]  
* <i class="fal fa-cog" aria-hidden="true"></i> [Certificate Configuration][]  
* <i class="fal fa-tools" aria-hidden="true"></i> [Batch Testing Script][]  
* <i class="fal fa-broom" aria-hidden="true"></i> [Cleanup and Diagnostic Script][]  
* <i class="fal fa-question-circle" aria-hidden="true"></i> [FAQ: Private Key Health Testing Scenarios][]  
* <i class="fal fa-question-circle" aria-hidden="true"></i> [FAQ: Weak Cryptography Testing Scenarios][]  
* <i class="fal fa-question-circle" aria-hidden="true"></i> [FAQ: Chain Validation Testing Scenarios][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/MonitorAgent/WindowsServer/Certificates/CertificatePurposeValidation.png

[Batch Testing Script]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/troubleshooting/scripts/batch-testing-script/
[Certificate Configuration]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/configuration/
[Certificate Monitoring]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/monitoring/
[Certificate Overview]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/overview/
[Certificate Purpose and EKU]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/certificate-purpose-and-eku/
[Cleanup and Diagnostic Script]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/troubleshooting/scripts/cleanup-and-diagnostic-script/
[Code Signing]:https://docs.nodinite.com/core-services/security/code-signing-and-binary-integrity/
[Expected State]:https://docs.nodinite.com/administration/monitor-management/resources/features/expected-state/
[FAQ: Chain Validation Testing Scenarios]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/troubleshooting/faq-chain-validation-testing-scenarios/
[FAQ: Private Key Health Testing Scenarios]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/troubleshooting/faq-private-key-health-testing/
[FAQ: Weak Cryptography Testing Scenarios]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/certificates/troubleshooting/faq-weak-cryptography-testing-scenarios/
[IBM MQ SSL FAQ]:https://docs.nodinite.com/logging-and-monitoring/ibm-mq/troubleshooting/faq-ssl-certificate-configuration/
[IIS]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/iis/
[Web Client]:https://docs.nodinite.com/getting-started/overview/
[Windows Server]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/windows-server/
[Windows Server Monitoring Agent]:https://docs.nodinite.com/logging-and-monitoring/windows-server/overview/