

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 搭配使用 `DescribeConfigurationRecorderStatus` 與 CLI
<a name="config-service_example_config-service_DescribeConfigurationRecorderStatus_section"></a>

下列程式碼範例示範如何使用 `DescribeConfigurationRecorderStatus`。

------
#### [ CLI ]

**AWS CLI**  
**取得組態記錄器的狀態資訊**  
下列命令會傳回預設組態記錄器的狀態：  

```
aws configservice describe-configuration-recorder-status
```
輸出：  

```
{
    "ConfigurationRecordersStatus": [
        {
            "name": "default",
            "lastStatus": "SUCCESS",
            "recording": true,
            "lastStatusChangeTime": 1452193834.344,
            "lastStartTime": 1441039997.819,
            "lastStopTime": 1441039992.835
        }
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeConfigurationRecorderStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configservice/describe-configuration-recorder-status.html)。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**範例 1：此範例傳回組態記錄器的狀態。**  

```
Get-CFGConfigurationRecorderStatus
```
**輸出：**  

```
LastErrorCode        :
LastErrorMessage     :
LastStartTime        : 10/11/2019 10:13:51 AM
LastStatus           : Success
LastStatusChangeTime : 12/31/2019 6:14:12 AM
LastStopTime         : 10/11/2019 10:13:46 AM
Name                 : default
Recording            : True
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [DescribeConfigurationRecorderStatus](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：此範例傳回組態記錄器的狀態。**  

```
Get-CFGConfigurationRecorderStatus
```
**輸出：**  

```
LastErrorCode        :
LastErrorMessage     :
LastStartTime        : 10/11/2019 10:13:51 AM
LastStatus           : Success
LastStatusChangeTime : 12/31/2019 6:14:12 AM
LastStopTime         : 10/11/2019 10:13:46 AM
Name                 : default
Recording            : True
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [DescribeConfigurationRecorderStatus](https://docs.aws.amazon.com/powershell/v5/reference)。

------