[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003eThis guide explains how to delete workforce users and the data they own on Google Cloud, emphasizing that deleting a user also deletes all their associated data.\u003c/p\u003e\n"],["\u003cp\u003eDeleting users and data involves initiating a delete request using a specific user resource ID format: \u003ccode\u003eprincipal://iam.googleapis.com/locations/<var translate="no">LOCATION</var>/workforcePools/<var translate="no">WORKFORCE_POOL_ID</var>/subject/<var translate="no">SUBJECT_ID</var>\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe data deletion process includes a 30-day soft-deletion state where data can be recovered, followed by a purged state where data is permanently deleted and unrecoverable.\u003c/p\u003e\n"],["\u003cp\u003eYou can recover users and data that are in the soft-deletion state by using the command \u003ccode\u003egcloud iam workforce-pools subjects undelete\u003c/code\u003e, but you need to have the appropriate permissions such as \u003ccode\u003eiam.googleapis.com/workforcePoolSubjects.undelete\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe process to delete workforce users and data is initiated with the command \u003ccode\u003egcloud iam workforce-pools subjects delete\u003c/code\u003e, and it requires you to specify the workforce pool and subject IDs.\u003c/p\u003e\n"]]],[],null,["# Delete Workforce Identity Federation users and their data\n\nThis guide shows you how to delete workforce users (also known as principals)\nand data that they exclusively own, collectively \"users and data\". To learn more\nabout how Google Cloud deletes data, see [Data deletion on Google Cloud](/docs/security/deletion).\n\nDelete Workforce Identity Federation user data\n----------------------------------------------\n\n| **Caution:** Deleting users also deletes all of their data on Google Cloud.\n\nTo delete workforce users and data, you must initiate a delete request with a\nuser resource ID that is formatted as follows: \n\n principal://iam.googleapis.com/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/workforcePools/\u003cvar translate=\"no\"\u003eWORKFORCE_POOL_ID\u003c/var\u003e/subject/\u003cvar translate=\"no\"\u003eSUBJECT_ID\u003c/var\u003e\n\nThe stages in the data-deletion pipeline are as follows:\n\n**Stage-1: Soft-deletion state:** After you initiate a delete request, the\nusers and data are immediately marked for deletion and enter a 30-day soft-\ndeletion state. In that state, the data can be deleted at anytime. After it is\ndeleted, it cannot be accessed unless it is first recovered. You can *usually*\nrecover data that is in this state.\n\n**Stage-2: Purged state:** Users and data that remain deleted longer than 30\ndays are in the purged state, meaning they are permanently deleted and cannot be\nrecovered. After the\ndata enters the purged state, the user identifier can be reused and assigned to\nanother user. This is because the identifier is processed as a new entity in\nIdentity and Access Management (IAM).\n\n### Required permissions\n\nThis section details the IAM roles or permissions required to\nperform delete and undelete operations.\n\nThe permissions are as follows:\n\n- `iam.googleapis.com/workforcePoolSubjects.delete`\n- `iam.googleapis.com/workforcePoolSubjects.undelete`\n\nThese permissions are included in the Workforce Pool Admin role\n(`roles/iam.workforcePoolAdmin`).\n\n### Delete users and data\n\nTo delete users and data, do the following: \n\n### gcloud\n\nExecute the following command: \n\n gcloud iam workforce-pools subjects delete \\\n \u003cvar translate=\"no\"\u003eSUBJECT_ID\u003c/var\u003e \\\n --workforce-pool=\u003cvar translate=\"no\"\u003eWORKFORCE_POOL_ID\u003c/var\u003e \\\n --location=global\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSUBJECT_ID\u003c/var\u003e: the user resource ID to delete.\n- \u003cvar translate=\"no\"\u003eWORKFORCE_POOL_ID\u003c/var\u003e: the workforce pool ID.\n\n### Undelete users and data\n\nDuring the soft-deletion or pre-purge deletion phase, you can undo a\nuser deletion.\n\nTo undelete a user, do the following: \n\n### gcloud\n\nTo undo a user deletion, execute the following command: \n\n gcloud iam workforce-pools subjects undelete \u003cvar translate=\"no\"\u003eSUBJECT_ID\u003c/var\u003e \\\n --workforce-pool=\u003cvar translate=\"no\"\u003eWORKFORCE_POOL_ID\u003c/var\u003e \\\n --location=global\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSUBJECT_ID\u003c/var\u003e: the user resource ID for which to undo a previous delete.\n- \u003cvar translate=\"no\"\u003eWORKFORCE_POOL_ID\u003c/var\u003e: the workforce pool ID."]]