> 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/ja/zheng-ming-shu-guan-li/guan-li-rest-api/scepmanclient-no-api.md).

# SCEPmanClient の管理 API

使用 `Find-SCEPmanCertificate` SCEPman で発行済み証明書を検索し、 `Revoke-SCEPmanCertificate` 証明書がもはや信頼されていない、または不要になったときに失効させます。

### 要件

証明書を検索または失効する前に、あなたの ID に次の **Manage.All** ロール。

また、SCEPmanClient の使用に必要な一般的な前提条件が設定されていることも確認してください: [https://app.gitbook.com/o/-LhPlvZ6dc8XcqY7tdZw/s/-LoGejQeUQcw7lqnQ3WX/\~/edit/\~/changes/863/certificate-management/api-certificates/scepmanclient#prerequisites](/ja/zheng-ming-shu-guan-li/api-certificates/scepmanclient.md#prerequisites)

{% hint style="info" %}
以前の SCEPman バージョンから更新した場合、まだ Manage.All ロールがない可能性があります。次を実行してください `Complete-SCEPmanInstallation` をクラウド シェルで再度実行して、自動的に SCEPman-api アプリケーションに追加してください。
{% endhint %}

### 証明書を検索

使用 `Find-SCEPmanCertificate` シリアル番号、サブジェクト、または要求者で証明書を検索します。

少なくとも 1 件の証明書が見つかった場合、次の JSON 構造に似たオブジェクトが返されます:

```json
{
  "items": [
    {
    "serialNumber":  "507AEAC03CCEF83F106914418D9222E466A629C1",
    "subject":  "CN=device01.contoso.local",
    "sans":  null,
    "upn":  null,
    "issuanceDate":  "2026-05-28T10:57:22Z",
    "expirationDate":  "2028-05-28T10:57:22Z",
    "revocationDate":  null,
    "revocationReason":  null,
    "revokedBy":  null,
    "requester":  "pkiAdmin@contoso.com",
    "source":  "CertificateMaster",
    "certificateType":  "Static"
    }
  ],
  "continuationToken": "..."
}
```

#### 例: シリアル番号で 1 件の証明書を検索する

```powershell
Find-SCEPmanCertificate -Url scepman.conitoso.com `
    -SearchText '5056BB9B823132CB26210A4C90A62FB3C25E38D0' `
    | Select-Object -ExpandProperty items

serialNumber     : 5056BB9B823132CB26210A4C90A62FB3C25E38D0
subject          : CN=clara.oswald@contoso.com
sans             : clara.oswald@contoso.com
upn              : clara.oswald@contoso.com
issuanceDate     : 2026-05-28T11:06:11Z
expirationDate   : 2028-05-28T11:06:11Z
revocationDate   :
revocationReason :
revokedBy        :
requester        : pkiAdmin@contoso.com
source           : CertificateMaster
certificateType  : Static
```

### ページ分割された結果を理解する

結果セットが大きい場合、 `Find-SCEPmanCertificate` 継続トークンを返すことがあります。このトークンを使って次のページを要求します。

#### 例: 継続トークン付きの最初のページ

```powershell
$result = Find-SCEPmanCertificate -Url scepman.contoso.com -SearchText "CN=device"
$result
```

出力例:

```powershell
ContinuationToken : 1!48!ODY2OURBN0QtQzk0My00QjU3LUI5OEYtNzA5RjY5MDlCRDkw
Items             : {@{serialNumber=60B26DD32CF07F30D6760848A5233CBAE90DCDBC; subject=CN=device01.contoso.local},
                    @{serialNumber=50F1754E85238752527C3140ABD0CEF2C7DC9439; subject=CN=device02.contoso.local}}
```

#### 返された証明書の詳細を表示する

```powershell
$result = Find-SCEPmanCertificate -Url scepman.contoso.com -SearchText "CN=device"
$result.Items
```

出力例:

```powershell
serialNumber                             subject
------------                             -------
60B26DD32CF07F30D6760848A5233CBAE90DCDBC CN=device01.contoso.local
50F1754E85238752527C3140ABD0CEF2C7DC9439 CN=device02.contoso.local
```

#### 継続トークンを使って次のページを要求する

```powershell
$firstPage = Find-SCEPmanCertificate -Url scepman.contoso.com -SearchText "CN=device"
$nextPage = Find-SCEPmanCertificate -Url scepman.contoso.com -ContinuationToken $firstPage.ContinuationToken
$nextPage.Items
```

出力例:

```powershell
serialNumber                             subject
------------                             -------
5048D2541F7F401C42B7E943A7C82FB37A179F83 CN=device03.contoso.local
50BCCDA973AEEA55E00FAF4A9A088DFB7564F263 CN=device04.contoso.local
```

### 証明書を失効させる

使用 `Revoke-SCEPmanCertificate` 以前に発行された証明書をシリアル番号で失効させます。

```powershell
Revoke-SCEPmanCertificate -SerialNumber "480552CEBBE40FD5D4417532033728F353040000" -RevocationReason CessationOfOperation
```

#### 例: 証明書を検索して失効させる

```powershell
$result= Find-SCEPmanCertificate -Url scepman.contoso.com -SearchText "480552CEBBE40FD5D4417532033728F353040000"
$cert = $result.items

Revoke-SCEPmanCertificate -SerialNumber $cert.Items[0].serialNumber
```

出力例:

```powershell
Revoke-SCEPmanCertificate: 証明書 480552CEBBE40FD5D4417532033728F353040000 は正常に失効されました。
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scepman.com/ja/zheng-ming-shu-guan-li/guan-li-rest-api/scepmanclient-no-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
