在 Azure Active Directory 中还原已删除的 Microsoft 365 组Restore a deleted Microsoft 365 group in Azure Active Directory

在 Azure Active Directory (Azure AD) 中删除某个 Microsoft 365 组后,删除的组会保留,但从删除日期开始算起的 30 天内将不可见。When you delete an Microsoft 365 group in the Azure Active Directory (Azure AD), the deleted group is retained but not visible for 30 days from the deletion date. 此行为是为了在需要时可以还原组及其内容。This behavior is so that the group and its contents can be restored if needed. 此功能仅适用于 Azure AD 中的 Microsoft 365 组,This functionality is restricted exclusively to Microsoft 365 groups in Azure AD. 而不适用于安全组和分发组。It is not available for security groups and distribution groups. 请注意,30 天的组还原期不可自定义。Please note that the 30-day group restoration period is not customizable.

备注

请勿使用 Remove-MsolGroup,因为它会永久清除组。Don't use Remove-MsolGroup because it purges the group permanently. 始终使用 Remove-AzureADMSGroup 来删除 Microsoft 365 组。Always use Remove-AzureADMSGroup to delete an Microsoft 365 group.

还原组所需的权限可能是下列其中一项:The permissions required to restore a group can be any of the following:

角色Role 权限Permissions
全局管理员、组管理员和 Intune 管理员Global administrator, Group administrator and Intune administrator 可以还原任何已删除的 Microsoft 365 组Can restore any deleted Microsoft 365 group
用户管理员User administrator 可以还原任何已删除的 Microsoft 365 组,但分配给公司管理员角色的组除外Can restore any deleted Microsoft 365 group except those groups assigned to the Company Administrator role
UserUser 可以还原他们拥有的任何已删除 Microsoft 365 组Can restore any deleted Microsoft 365 group that they own

查看和管理可还原的已删除 Microsoft 365 组View and manage the deleted Microsoft 365 groups that are available to restore

  1. 使用用户管理员帐户登录到 Azure AD 管理中心Sign in to the Azure AD admin center with a User administrator account.

  2. 选择“组”,然后选择“已删除的组”,查看可还原的已删除组 。Select Groups, then select Deleted groups to view the deleted groups that are available to restore.

    查看可供还原的组

  3. 可以在“已删除的组”边栏选项卡上执行以下操作:On the Deleted groups blade, you can:

    • 选择“还原组”,从而还原已删除的组及其内容。Restore the deleted group and its contents by selecting Restore group.
    • 选择“永久删除”,从而永久删除已删除的组。Permanently remove the deleted group by selecting Delete permanently. 只有管理员才能永久删除某个组。To permanently remove a group, you must be an administrator.

使用 Powershell 查看可还原的已删除 Microsoft 365 组View the deleted Microsoft 365 groups that are available to restore using Powershell

可以使用以下 cmdlet 查看已删除的组,确认尚未永久清除的、想要还原的一个或多个组。The following cmdlets can be used to view the deleted groups to verify that the one or ones you're interested in have not yet been permanently purged. 这些 cmdlet 属于 Azure AD PowerShell 模块These cmdlets are part of the Azure AD PowerShell module. Azure Active Directory PowerShell 版本 2 一文中介绍了此模块的详细信息。More information about this module can be found in the Azure Active Directory PowerShell Version 2 article.

  1. 运行以下 cmdlet,以显示 Azure AD 组织中所有已删除但仍可还原的 Microsoft 365 组。Run the following cmdlet to display all deleted Microsoft 365 groups in your Azure AD organization that are still available to restore.

    Get-AzureADMSDeletedGroup
    
  2. 或者,如果知道特定组的 objectID(可通过步骤 1 中的 cmdlet 来获取该 ID),可运行以下 cmdlet 来确认已删除的但尚未永久清除的特定组。Alternately, if you know the objectID of a specific group (and you can get it from the cmdlet in step 1), run the following cmdlet to verify that the specific deleted group has not yet been permanently purged.

    Get-AzureADMSDeletedGroup -Id <objectId>
    

如何使用 Powershell 还原已删除的 Microsoft 365 组How to restore your deleted Microsoft 365 group using Powershell

确认组仍可还原后,可以使用以下步骤之一还原已删除的组。Once you have verified that the group is still available to restore, restore the deleted group with one of the following steps. 如果该组包含文档、SP 站点或其他持久对象,可能需要 24 小时才能完全还原该组及其内容。If the group contains documents, SP sites, or other persistent objects, it might take up to 24 hours to fully restore a group and its contents.

  1. 运行以下 cmdlet 还原该组及其内容。Run the following cmdlet to restore the group and its contents.

     Restore-AzureADMSDeletedDirectoryObject -Id <objectId>
    
  2. 或者,可运行以下 cmdlet 永久清除已删除的组。Alternatively, the following cmdlet can be run to permanently remove the deleted group.

    Remove-AzureADMSDeletedDirectoryObject -Id <objectId>
    

如何知道是否还原成功?How do you know this worked?

若要验证是否已成功还原 Microsoft 365 组,请运行 Get-AzureADGroup -ObjectId <objectId> cmdlet 显示有关该组的信息。To verify that you’ve successfully restored an Microsoft 365 group, run the Get-AzureADGroup -ObjectId <objectId> cmdlet to display information about the group. 完成还原请求后:After the restore request is completed:

  • 该组显示在 Exchange 的左侧导航栏中The group appears in the Left navigation bar on Exchange
  • 该组的计划会显示在 Planner 中The plan for the group will appear in Planner
  • 任何 SharePoint 站点及其所有内容都将可用Any SharePoint sites and all of their contents will be available
  • 可从任何 Exchange 终结点以及支持 Microsoft 365 组的其他 Microsoft 365 工作负荷访问该组The group can be accessed from any of the Exchange endpoints and other Microsoft365 workloads that support Microsoft 365 groups

后续步骤Next steps

以下文章提供了有关 Azure Active Directory 组的更多信息。These articles provide additional information on Azure Active Directory groups.