

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

# 取消註冊 S3 Storage Lens 的委派管理員
<a name="storage_lens_with_organizations_deregistering_delegated_admins"></a>

啟用受信任存取之後，您還可以註冊委派管理員，以便存取組織中的帳戶。委派的管理員帳戶允許您[管理帳戶](https://docs.aws.amazon.com/managedservices/latest/userguide/management-account.html)以外的其他帳戶建立組織層級儀表板。只有組織的管理帳戶可以透過組織委派管理員的身分取消註冊帳戶。

您可以使用 AWS Organizations AWS 管理主控台、REST API AWS CLI、 或 AWS SDKS 從管理帳戶取消註冊委派管理員。如需詳細資訊，請參閱 *AWS Organizations API 參考*中的 [https://docs.aws.amazon.com/organizations/latest/APIReference/API_DeregisterDelegatedAdministrator.html](https://docs.aws.amazon.com/organizations/latest/APIReference/API_DeregisterDelegatedAdministrator.html)。

當帳戶取消委派管理員註冊時，帳戶會失去對下列各項的存取權：
+ 提供組織成員和結構可見性的所有唯讀 AWS Organizations API 操作。
+ 委派管理員建立的所有組織層級儀表板。取消註冊委派管理員也會自動防止透過該委派管理員建立的所有組織層級儀表板彙總新的儲存指標。
**注意**  
已取消註冊的委派管理員帳戶仍然可以查看其所建立但已停用的儀表板歷史資料 (若該資料仍然可供查詢)。

# 使用 S3 主控台
<a name="storage_lens_console_organizations_deregistering_delegated_admins"></a>

**取消註冊 S3 Storage Lens 的委派管理員**

1. 登入 AWS 管理主控台 ，並在 https：//[https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/) 開啟 Amazon S3 主控台。

1. 在左側導覽窗格上，導覽至 **Storage Lens**。

1.  選擇 **AWS Organizations 設定**。

1. 在**委派的管理員**下，選擇您要取消註冊的帳戶。

1. 選擇**取消註冊帳戶**。已取消註冊的帳戶不再是委派的管理員，而且現在無法為組織中的所有帳戶和儲存體建立組織層級儀表板。

1. 選擇**註冊帳戶**。

# 使用 AWS CLI
<a name="OrganizationsDeregisterDelegatedAdministratorS3LensCLI"></a>

**Example**  
下列範例示範如何使用 AWS CLI取消註冊 S3 Storage Lens 的 Organizations 委派管理員。若要使用此範例，請以您自己的 AWS 帳戶 ID 取代 `111122223333`。  

```
aws organizations deregister-delegated-administrator --service-principal storage-lens.s3.amazonaws.com --account-id 111122223333
```

# 使用適用於 Java 的 AWS 開發套件
<a name="OrganizationsDeregisterDelegatedAdministratorS3LensJava"></a>

**Example – 取消註冊 S3 Storage Lens 的 Organizations 委派管理員**  
下列範例示範如何使用適用於 Java 的 SDK 取消註冊 S3 Storage Lens 的 Organizations 委派管理員。若要使用此範例，請以您自己的資訊取代 `user input placeholders`。  

```
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.organizations.AWSOrganizations;
import com.amazonaws.services.organizations.AWSOrganizationsClient;
import com.amazonaws.services.organizations.model.DeregisterDelegatedAdministratorRequest;

public class DeregisterOrganizationsDelegatedAdministrator {
	private static final String S3_STORAGE_LENS_SERVICE_PRINCIPAL = "storage-lens.s3.amazonaws.com";

	public static void main(String[] args) {
		try {
            String delegatedAdminAccountId = "111122223333"; // Account Id for the delegated administrator.
            AWSOrganizations organizationsClient = AWSOrganizationsClient.builder()
                .withCredentials(new ProfileCredentialsProvider())
                .withRegion(Regions.US_EAST_1)
                .build();

            organizationsClient.deregisterDelegatedAdministrator(new DeregisterDelegatedAdministratorRequest()
                .withAccountId(delegatedAdminAccountId)
                .withServicePrincipal(S3_STORAGE_LENS_SERVICE_PRINCIPAL));
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but AWS Organizations couldn't process
            // it and returned an error response.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // AWS Organizations couldn't be contacted for a response, or the client
            // couldn't parse the response from AWS Organizations.
            e.printStackTrace();
        }
	}
}
```