如何使用 New-MgGroup 创建新的 Microsoft Entra ID 组

创建新的 Microsoft Entra ID 组

创建 Microsoft Entra ID 组是 IT 管理员管理组织内用户访问、安全性和协作的基本任务。无论是设置安全组、Microsoft 365 组还是通讯组,管理员都需要一种高效的方式来创建和配置它们。虽然 Microsoft Graph 中的 New-MgGroup PowerShell 命令允许管理员使用自定义属性创建组,但它缺乏用户友好的界面,并且需要深入的脚本知识。

为了更高效且用户友好的方法,ManageEngine ADManager Plus 提供了强大的内置管理操作。管理员无需编写复杂的 PowerShell 脚本即可快速创建和管理 Microsoft Entra ID 组。ADManager Plus 甚至支持批量创建 Microsoft Entra ID 组。

  • ADManager Plus
  • PowerShell
 

使用 ADManager Plus 创建新的 Microsoft Entra ID 组

  1. 登录 ADManager Plus。导航至 Microsoft 365 > Management > Group Management。
  2. 在 Single Group Creation 下,选择 Microsoft 365 Group Creation。
  3. 从下拉菜单中选择 Microsoft 365 Tenant。
  4. 从 Selected Template 列表中选择一个组创建模板。
  5. 下面有三个部分:General, Group, 和 Exchange。
  6. 输入所需的详细信息,如 Display Name 和 Primary SMTP Address。添加组成员,选择组所有者,并决定是否启用组的邮件功能。
  7. 添加必要信息后,点击 Apply。
使用ADManager Plus内置的管理操作创建新的Microsoft Entra ID组。
 
 

选择所需的 Microsoft 365 租户。

 
 

创建新的 Microsoft Entra ID 组创建模板。

 
 

使用箭头按钮在各标签页之间导航。

使用 Microsoft Graph PowerShell 创建新的 Microsoft Entra ID 组

前提条件

在运行 New-MgGroup cmdlet 之前,请确保满足以下要求:

  • The Microsoft Graph PowerShell module is installed. If it’s not installed, use the following command:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the necessary permissions to read group details:
    Connect-MgGraph -Scopes "Group.Read.All"

使用 New-MgGroup cmdlet 创建新的 Microsoft Entra ID 组

使用 Microsoft Graph PowerShell 中的 New-MgGroup cmdlet 创建新的 Microsoft Entra ID 组。语法如下:

New-MgGroup [-ResponseHeadersVariable <String>]
[-AcceptedSenders <IMicrosoftGraphDirectoryObject[]>]
[-AdditionalProperties <Hashtable>]
[-AllowExternalSenders]
[-AppRoleAssignments <IMicrosoftGraphAppRoleAssignment[]>]
[-AssignedLabels <IMicrosoftGraphAssignedLabel[]>]
[-AssignedLicenses <IMicrosoftGraphAssignedLicense[]>]
[-AutoSubscribeNewMembers]
[-Calendar <IMicrosoftGraphCalendar>]
[-CalendarView <IMicrosoftGraphEvent[]>]
[-Classification <String>]
[-Conversations <IMicrosoftGraphConversation[]>]
[-CreatedDateTime <DateTime>]
[-CreatedOnBehalfOf <IMicrosoftGraphDirectoryObject>]
[-DeletedDateTime <DateTime>]
[-Description <String>]
[-DisplayName <String>]
[-Drive <IMicrosoftGraphDrive>]
[-Drives <IMicrosoftGraphDrive[]>]
[-Events <IMicrosoftGraphEvent[]>]
[-ExpirationDateTime <DateTime>]
[-Extensions <IMicrosoftGraphExtension[]>]
[-GroupLifecyclePolicies <IMicrosoftGraphGroupLifecyclePolicy[]>]
[-GroupTypes <String[]>]
[-HasMembersWithLicenseErrors]
[-HideFromAddressLists]
[-HideFromOutlookClients]
[-Id <String>]
[-IsArchived]
[-IsAssignableToRole]
[-IsManagementRestricted]
[-IsSubscribedByMail]
[-LicenseProcessingState <IMicrosoftGraphLicenseProcessingState>]
[-Mail <String>]
[-MailEnabled]
[-MailNickname <String>]
[-MemberOf <IMicrosoftGraphDirectoryObject[]>]
[-Members <IMicrosoftGraphDirectoryObject[]>]
[-MembersWithLicenseErrors <IMicrosoftGraphDirectoryObject[]>]
[-MembershipRule <String>]
[-MembershipRuleProcessingState <String>]
[-OnPremisesDomainName <String>]
[-OnPremisesLastSyncDateTime <DateTime>]
[-OnPremisesNetBiosName <String>]
[-OnPremisesProvisioningErrors <IMicrosoftGraphOnPremisesProvisioningError[]>]
[-OnPremisesSamAccountName <String>]
[-OnPremisesSecurityIdentifier <String>]
[-OnPremisesSyncEnabled]
[-Onenote <IMicrosoftGraphOnenote>]
[-Owners <IMicrosoftGraphDirectoryObject[]>]
[-PermissionGrants <IMicrosoftGraphResourceSpecificPermissionGrant[]>]
[-Photo <IMicrosoftGraphProfilePhoto>]
[-Photos <IMicrosoftGraphProfilePhoto[]>]
[-Planner <IMicrosoftGraphPlannerGroup>]
[-PreferredDataLocation <String>]
[-PreferredLanguage <String>]
[-ProxyAddresses <String[]>]
[-RejectedSenders <IMicrosoftGraphDirectoryObject[]>]
[-RenewedDateTime <DateTime>]
[-SecurityEnabled]
[-SecurityIdentifier <String>]
[-ServiceProvisioningErrors <IMicrosoftGraphServiceProvisioningError[]>]
[-Settings <IMicrosoftGraphGroupSetting[]>]
[-Sites <IMicrosoftGraphSite[]>]
[-Team <IMicrosoftGraphTeam>]
[-Theme <String>]
[-Threads <IMicrosoftGraphConversationThread[]>]
[-TransitiveMemberOf <IMicrosoftGraphDirectoryObject[]>]
[-TransitiveMembers <IMicrosoftGraphDirectoryObject[]>]
[-UniqueName <String>]
[-UnseenCount <Int32>]
[-Visibility <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]

使用 New-MgGroup cmdlet 的示例用例和脚本

示例:如何创建新的 Microsoft Entra ID 组

New-MgGroup -DisplayName 'Test Group' -MailEnabled:$False -MailNickName 'testgroup' -SecurityEnabled

支持的参数

下表列出了可与 New-MgGroup cmdlet 一起使用的关键参数,以高效创建新的 Microsoft Entra ID 组。

参数 描述
- AcceptedSenders 指定被授权在组内发布帖子或日历事件的用户或组。
-AdditionalProperties 指定附加参数。
-AllowExternalSenders 指定组织外部人员是否可以向该组发送消息。
-AppRoleAssignments 指示分配给组的应用角色。
-AssignedLicenses 显示授予组的许可证。
-Confirm 运行 cmdlet 前提示管理员确认。

使用 Graph PowerShell 脚本创建新的 Microsoft Entra ID 组的挑战

  • 分配正确的角色和权限具有挑战性,因为某些命令需要提升权限,而这些权限可能不易授予。
  • Microsoft 强制执行 API 速率限制,这可能会中断批量操作,并需要重试逻辑以防止失败。
  • 并非所有 Microsoft Graph 功能都有专用的 PowerShell cmdlet,某些操作需要手动调用 API。
  • 管理员需要广泛的 PowerShell 技能,才能从 Azure AD PowerShell 转向 Microsoft Graph PowerShell。

使用 ADManager Plus 创建 Microsoft Entra ID 组的亮点

  • Manage 本地 Active Directory 和 Microsoft Entra ID,均可通过单一控制台完成。
  • 使用直观的UI轻松执行管理操作,无需运行PowerShell脚本。
  • 通过CSV导入和模板,轻松批量执行各种任务。
  • 自动化常规任务并设置基于审批的工作流。
  • 使用详细报告跟踪组织中的变更,以满足合规和审计需求。

使用ADManager Plus无缝创建、更新和删除Microsoft Entra ID组。

 
  • 创建新的 Microsoft Entra ID 组
  • 使用 ADManager Plus 创建新的 Microsoft Entra ID 组
  • 使用 Microsoft Graph PowerShell 创建新的 Microsoft Entra ID 组
  • 使用Graph PowerShell脚本创建Microsoft Entra ID组的挑战
  • 使用 ADManager Plus 创建 Microsoft Entra ID 组的亮点
Active Directory管理与报告的一站式解决方案
电子邮件下载链接 Email the ADManager Plus download link