Set-EntraGroup
Sets the properties for an existing Microsoft Entra ID group.
Syntax
Default (Default)
Set-EntraGroup
-GroupId <String>
[-DisplayName <String>]
[-GroupTypes <System.Collections.Generic.List`1[System.String]>]
[-SecurityEnabled <Boolean>]
[-Description <String>]
[-MailEnabled <Boolean>]
[-MailNickname <String>]
[-Visibility <String>]
[-IsAssignableToRole <Boolean>]
[<CommonParameters>]
Description
The Set-EntraGroup
cmdlet sets the properties for an existing Microsoft Entra ID group. Specify the GroupId
parameter to set the properties for an existing Microsoft Entra ID group.
Examples
Example 1: Update a group display name
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraGroup -Filter "displayName eq 'HelpDesk Team Leaders'"
Set-EntraGroup -GroupId $group.Id -DisplayName 'Global HelpDesk Team Leaders'
This command updates the display name of a specified group in Microsoft Entra ID.
Example 2: Update a group description
Connect-Entra -Scopes 'Group.ReadWrite.All'
Get-EntraGroup -Filter "displayName eq 'HelpDesk Team Leaders'" | Set-EntraGroup -Description 'HelpDesk Team Leaders Global'
This example demonstrates how to update a group description.
Example 3: Update a group mail nickname
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
Set-EntraGroup -GroupId $group.Id -MailNickName 'newnickname'
This command updates the mail nickname of a specified group in Microsoft Entra ID.
Example 4: Update a group security enabled
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
Set-EntraGroup -GroupId $group.Id -SecurityEnabled $True
This command updates the security enabled of a specified group in Microsoft Entra ID.
Example 5: Update a group mail enabled
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
Set-EntraGroup -GroupId $group.Id -MailEnabled $False
This example demonstrates how to update a group main enabled.
Example 6: Update a property for a group
Connect-Entra -Scopes 'Group.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'HelpDesk Team Leaders'"
Set-EntraGroup -GroupId $group.Id -Visibility 'Private' -GroupTypes 'DynamicMembership' -IsAssignableToRole $True
This example demonstrates how to update a property for an existing Microsoft Entra ID group.
Parameters
-Description
Specifies a description for the group.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DisplayName
Specifies a display name for the group.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-GroupId
Specifies the object ID of a group.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Id |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-GroupTypes
Specifies that the group is a dynamic group. To create a dynamic group, specify a value of DynamicMembership.
Parameter properties
Type: | System.Collections.Generic.List`1[System.String] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-IsAssignableToRole
This property can only be set at the time of group creation and can't be modified on an existing group.
Parameter properties
Type: | System.Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-MailEnabled
Indicates whether this group is mail enabled.
Parameter properties
Type: | System.Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-MailNickname
Specifies a mail nickname for the group.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-SecurityEnabled
Indicates whether the group is security enabled.
Parameter properties
Type: | System.Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Visibility
Specifies the visibility of the group's content and members list. This parameter can take one of the following values:
- "Public": Anyone can view the contents of the group.
- "Private": Only members can view the content of the group.
- "HiddenMembership": Only members can view the content of the group and only members, owners, Global/Company Administrator, User Administrator, and Helpdesk Administrators can view the members list of the group.
If no value is provided, the default value is "Public."
Notes:
- This parameter is only valid for groups that have the groupType set to "Unified."
- If a group has this attribute set to "HiddenMembership," it can't be changed later.
- Anyone can join a group that has this attribute set to "Public." If the attribute is set to Private or HiddenMembership, only owner can add new members to the group and requests to join the group need approval of the owner.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.