> For the complete documentation index, see [llms.txt](https://docs.scepman.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scepman.com/de/zertifikatsverwaltung/api-certificates/api-enrollment/windows-server.md).

# Windows-Server

{% hint style="info" %}
Gilt für SCEPman Version 2.9 und höher
{% endhint %}

Sie können das SCEPmanClient PowerShell-Modul verwenden, um Zertifikate für Ihren Windows-Server anzufordern. Bitte beachten Sie den Hauptartikel des Moduls für die Voraussetzungen:

{% content-ref url="/pages/dbb1c25b5c5378e0bfea99026d67efd5eddf2f37" %}
[SCEPmanClient](/de/zertifikatsverwaltung/api-certificates/scepmanclient.md)
{% endcontent-ref %}

## Beschreibung des Anwendungsfalls

Obwohl das Modul in der Lage ist, Zertifikate zunächst anzufordern, ist es möglicherweise nicht wünschenswert, die Service Principal-Anmeldeinformationen auf einem Computer zu speichern, der zum Anfordern beliebiger Zertifikate verwendet werden könnte.

Wenn Ihr Szenario also die Bereitstellung eines Zertifikats mithilfe von Certificate Master umfasst, können Sie es automatisch erneuern mit *SCEPmanClient* indem Sie ein bereits vorhandenes Zertifikat zur Authentifizierung bereitstellen:

<pre class="language-powershell"><code class="lang-powershell"><strong>$Subject = $env:COMPUTERNAME
</strong><strong>$ValidityThreshold = 30
</strong>
<strong>$CertificateToRenew = Get-ChildItem Cert:\LocalMachine\My `
</strong>                        | Where-Object NotAfter -lt (Get-Date).AddDays($ValidityThreshold) `
                        | Where-Object Subject -match $Subject

New-SCEPmanCertificate -Certificate $CertificateToRenew -SaveToStore 'LocalMachine'

# Mit dem neuen Zertifikat an Ort und Stelle können wir das alte entfernen
# Remove-Item $CertificateToRenew.PSPath
</code></pre>

Dieses Beispiel findet Zertifikate, die im nächsten Monat ablaufen, und verwendet sie, um die Erneuerungsanfrage zu authentifizieren.

## Erstanfrage

Wenn Sie auf Ihrem Server zunächst Zertifikate anfordern möchten, können Sie dies tun, indem Sie einen Service Principal für die Authentifizierung angeben, dem die Rolle **CSR-DB-Anforderer** zugewiesen ist. Bitte beachten Sie die folgende Anleitung dazu, wie ein solcher Service Principal implementiert wird:

{% content-ref url="/pages/c6e9b6e18fdecafb14aaae14587abd1f7a62b135" %}
[API-Registrierung](/de/zertifikatsverwaltung/api-certificates/api-enrollment.md)
{% endcontent-ref %}

```powershell
$Parameters = @{
    'Url'              = 'scepman.contoso.com'
    'ClientId'         = '569fbf51-aa63-4b5c-8b26-ebbcfcde2715'
    'TenantId'         = '8aa3123d-e76c-42e2-ba3c-190cabbec531'
    'ClientSecret'     = 'csa8Q~aVaWCLZTzswIBGvhxUiEvhptuqEyJugb70'
    'Subject'          = 'CN=WebServer'
    'DNSName'          = 'Webserver.domain.local'
    'ExtendedKeyUsage' = 'ServerAuth'
    'SaveToStore'      = 'LocalMachine'
}

New-SCEPmanCertificate @Parameters
```

Wenn wir nun ein Zertifikat erneuern möchten, können wir den Service Principal außer Acht lassen und ein bereits ausgestelltes Zertifikat zur Authentifizierung verwenden. Dabei werden die Details des vorhandenen Zertifikats verwendet, um eine neue CSR zu erstellen und sie an SCEPman zu übermitteln, damit ein neues Zertifikat ausgestellt wird.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.scepman.com/de/zertifikatsverwaltung/api-certificates/api-enrollment/windows-server.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
