重要提示:我们不再接受 Play EMM API 的新注册。
了解详情。
升级用户账号
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
升级设备上的用户账号涉及从受管理的 Google Play 账号迁移到受管理的 Google 账号。此过程会将用户的身份从以设备为中心的非个人账号转移到与其公司 Google 身份相关联的账号。这种与公司身份的关联是改进和整合所有 Google 服务中的用户体验的基础。
概览
此次升级的主要目的是为客户提供增强功能,例如通过 Google 管理控制台改进用户管理、增强安全性,以及访问 Google 服务和 AI 功能(例如 Gemini)。
升级用户账号的主要优势:
适用于所有 Google 服务:与受管理的 Google Play 账号不同,此新身份可与所有 Google 服务(包括 Google 云端硬盘、Google 文档和 Google Meet)无缝协作。此外,如果 IT 管理员启用此功能,它还支持设备备份。
顺畅的用户体验:通过单点登录 (SSO) 集成,用户可以自动登录其公司环境和所有 Google 服务(例如 Gmail)。
直接身份控制:组织可以通过手动、自动或基于同步的方法直接控制身份生命周期。
熟悉的用户标识符:为了提高账号的辨识度,新账号使用用户已经知道并使用的同一电子邮件地址。
账户升级
若要将之前通过受管理的 Google Play 账号注册的设备升级为受管理的 Google 账号,您可以采用类似于标准设备注册流程的设置,但在令牌创建和设置后操作方面存在一些关键差异。
1. 创建用于账号升级的注册令牌
此步骤涉及创建专门为账号迁移配置的注册令牌。该令牌将强制执行 Google 身份验证,以将设备与受管理的 Google 账号相关联。
- 调用 Play EMM API 的
EnrollmentTokens.create()
方法。
- 将
enrollmentTokenType
设置为 USER_DEVICE
。
- 在
googleAuthenticationOptions
对象中:
- 将
authenticationRequirement
设置为 REQUIRED
。这样一来,注册时就必须使用 Google 账号。
- 将
requiredAccountEmail
设置为目标受管理的 Google 账号的电子邮件地址。这会引导设备上的流程提示用户输入此特定账号,或者,如果设备上已存在该账号,则在无需进一步进行用户身份验证的情况下静默执行升级。
2. 在设备上启动账号设置并处理身份验证
注册令牌可用后(例如,由 EMM 解决方案推送或通过界面提供),您可以使用与标准设备注册相同的 AccountSetupClient.startAccountSetup()
集成来添加或关联账号。
- 如果
requiredAccountEmail
中指定的受管 Google 账号已存在于设备上,系统不会提示用户进行身份验证,升级将以静默方式进行。
- 如果该账号不存在,系统会强制用户使用必需的电子邮件地址登录。由于令牌中的
authenticationRequirement
设置为 REQUIRED
,因此无法选择跳过 Google 身份验证。
3. 完成管理并移除旧账号
使用 AccountSetupListener
接收到 ADDED_ACCOUNT
状态后,并且 EMM 后端已成功将设备与新的受管理的 Google 账号相关联,请验证您的政策是否已应用于新用户。我们建议您在开始使用 Devices.update
API 启动升级之前,先应用目标用户的设备政策,以便顺利过渡。您可以通过调用 Users.list
来检索受管理的 Google 账号的用户 ID,该 ID 是调用 Devices.update
所必需的。
必须从设备中移除旧账号。
DPC 支持库为此提供了 dpcSupport.removeAllAndroidForWorkAccounts()
。
4. 启用 Google 服务
对于使用受管理的 Google 账号的知识工作者设备,请务必在设备符合企业政策后调用 Devices.setState()
。这是激活设备并授予用户对 Google 服务的完整访问权限所必需的。
特殊用例
账号升级流程在以下特殊用例中也很有用:
配套服务和第三方注册服务
账号升级流程通过以下流程简化了套装和第三方注册服务:
初始流程:设备注册为无用户设备。这会自动添加受管理的 Google Play 账号并应用一组默认政策。
政策更新:EMM 将新政策应用到设备。此政策要求用户先登录,然后才能使用设备。然后,将设备交付给最终用户。
用户升级:最终用户开启设备后,系统会提示其登录。此操作会触发账号升级流程,其中受管理的 Google 账号会取代受管理的 Google Play 账号。
最终清理:EMM 从设备中移除旧的受管理的 Google Play 账号。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-25。
[null,null,["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Upgrade user accounts\n\nUpgrading a user account on a device involves a migration from a\n**managed Google Play Account** to a **managed Google Account**. This process\nshifts the user's identity from a device-centric, non-personal\naccount to one that is tied to their corporate Google identity. This link to a\ncorporate identity is the foundation for an improved and more integrated user\nexperience across all Google services.\n\nOverview\n--------\n\nThe primary goal of this upgrade is to provide customers with enhanced features,\nsuch as improved user management through the Google Admin console, stronger\nsecurity, and access to Google services and AI capabilities like Gemini.\n\n### Key benefits of upgrading user accounts:\n\n- **Works with all Google services:** Unlike managed Google Play Accounts,\n this new identity works seamlessly with all Google services, including Google\n Drive, Docs, and Meet. It also supports device backup when enabled by the IT\n admin.\n\n- **Seamless user experience:** Through single sign-on (SSO) integration, users\n are automatically signed in to their corporate environment and all their Google\n services, such as Gmail.\n\n- **Direct identity control:** The organization can directly control the\n identity lifecycle through manual, automated, or sync-based methods.\n\n- **Familiar user identifier:** For better visibility, the new account uses the\n same email address that the user already knows and uses.\n\nAccount upgrade\n---------------\n\nTo upgrade a device previously enrolled with a **managed Google Play Account**\nto a **managed Google Account**, you can adopt a setup similar to the\nstandard device enrollment flow, but with key differences in token creation\nand post-setup actions.\n\n### 1. Create an enrollment token for account upgrade\n\nThis step involves creating an enrollment token specifically configured for\naccount migration. The token will force Google authentication to link the\ndevice to a managed Google Account.\n\n- Call the `EnrollmentTokens.create()` method of the Play EMM API.\n- Set `enrollmentTokenType` to `USER_DEVICE`.\n- Within the `googleAuthenticationOptions` object:\n- Set `authenticationRequirement` to `REQUIRED`. This makes a Google account mandatory for enrollment.\n- Set `requiredAccountEmail` to the email address of the target managed Google Account. This guides the on-device flow to either prompt the user for this specific account or, if it already exists on the device, perform the upgrade silently without further user authentication.\n\n### 2. Initiate account setup and handle authentication on the device\n\nOnce the enrollment token is available (e.g., pushed by your EMM solution\nor provided using a user interface), you can use the same\n[`AccountSetupClient.startAccountSetup()`](/android/management/reference/amapi/com/google/android/managementapi/setupactions/AccountSetupClient#startAccountSetup(android.content.Context,%20java.lang.String))\nintegration from standard device enrollment to add or associate the account.\n\n- If the managed Google Account specified in `requiredAccountEmail` already exists on the device, the user won't be prompted to authenticate, and the upgrade will proceed silently.\n- If the account does not exist, the user will be forced to sign in with the required email. Because `authenticationRequirement` is set to `REQUIRED` in the token, the option to skip Google authentication won't be available.\n\n### 3. Finalize management and remove the old account\n\nAfter the `ADDED_ACCOUNT` state is received using your `AccountSetupListener`\nand your EMM backend has successfully associated the device with the new managed\nGoogle Account, verify your policies are applied to the new user. We recommend\napplying the target user's device policies *before* initiating the upgrade using\nthe [`Devices.update`](/android/work/play/emm-api/v1/devices/update) API for a\nsmooth transition. You can retrieve the User ID of the managed Google Account,\nwhich is needed in order to call\n[`Devices.update`](/android/work/play/emm-api/v1/devices/update), by calling\n[`Users.list`](/android/work/play/emm-api/v1/users/list).\n\nRemoving the old account from the device is a required step.\nThe DPC Support Library provides `dpcSupport.removeAllAndroidForWorkAccounts()`\nfor this purpose.\n\n### 4. Enable Google services\n\nFor knowledge worker devices with a managed Google Account, remember to\ncall [`Devices.setState()`](/android/work/play/emm-api/v1/devices/setState)\nonce the device is compliant with your enterprise policies. This is necessary to\nactivate the device and grant the user full access to Google services.\n\nSpecial use case\n----------------\n\nThe account upgrade process is also beneficial in the following special\nuse case:\n\n*** ** * ** ***\n\n### Kitting and third-party enrollment services\n\nThe account upgrade flow simplifies **kitting** and **third-party\nenrollment services** by the following process:\n\n1. **Initial process:** A device is enrolled as a userless\n device. This automatically adds a managed Google Play Account and\n applies a set of default policies.\n\n2. **Policy update:** The EMM applies a new policy to the device. This policy\n requires a user login before the device can be used. The device is then\n delivered to the end user.\n\n3. **User upgrade:** When the end user powers on the device, they are\n prompted to sign in. This action triggers the account upgrade flow,\n where their managed Google Account replaces the managed Google Play\n Account.\n\n4. **Final cleanup:** The EMM removes the old managed Google\n Play Account from the device."]]