创建 Microsoft Entra ID 组是 IT 管理员管理组织内用户访问、安全性和协作的基本任务。无论是设置安全组、Microsoft 365 组还是通讯组,管理员都需要一种高效的方式来创建和配置它们。虽然 Microsoft Graph 中的 New-MgGroup PowerShell 命令允许管理员使用自定义属性创建组,但它缺乏用户友好的界面,并且需要深入的脚本知识。
为了更高效且用户友好的方法,ManageEngine ADManager Plus 提供了强大的内置管理操作。管理员无需编写复杂的 PowerShell 脚本即可快速创建和管理 Microsoft Entra ID 组。ADManager Plus 甚至支持批量创建 Microsoft Entra ID 组。
选择所需的 Microsoft 365 租户。
创建新的 Microsoft Entra ID 组创建模板。
使用箭头按钮在各标签页之间导航。
在运行 New-MgGroup cmdlet 之前,请确保满足以下要求:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Group.Read.All"
使用 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>]
示例:如何创建新的 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 前提示管理员确认。 |