Create a hidden AAD group

Viewed 98

How do I create a hidden AAD group (number of users should be listed as 0) in a demo tenant?

I created a hidden group via

New-UnifiedGroup -DisplayName "group-name" HiddenGroupMembershipEnabled

but I still see all the members in the group. What am I missing?

1 Answers

To create hidden Azure AD Group, you can make use of below command:

New-AzureADMSGroup -DisplayName "Group_Name" -groupTypes "Unified" -Visibility "HiddenMembership" -SecurityEnabled $False -MailEnabled $True -MailNickname "mail_name" 

Make sure to have AzureADPreview module installed before running the above command.

If you created Azure AD group with "HiddenMembership", the valid users who can see that group members are:

  • Group Owner.
  • Group Members.
  • Users who have admin roles.

Other than the above, if anyone tried to fetch the group members, they won't get any list of group members (same as 0 users).

I tried to reproduce the same in my environment and got the below results:

I created one Azure AD group with "HiddenMembership" and added few members using below script:

Connect-AzureAD
New-AzureADMSGroup -DisplayName "HiddenMem_Group" -Description "Hidden Members Group" -groupTypes "Unified" -Visibility "HiddenMembership" -SecurityEnabled $False -MailEnabled $True -MailNickname "hide_mem" 
Add-AzureADGroupMember -ObjectId "GroupID" -RefObjectId "User_ObjectID"

Response:

enter image description here

Please note that, the user who created group will be Group Owner of that group by default like below:

enter image description here

As Testdemo is Group Owner, he can get the list of group members using command like below:

Get-AzureADGroupMember -ObjectId <Group_ObjectID>

Response:

enter image description here

When a normal user with no admin roles and not a member of that group runs the same command, he won't get any response (same as 0 users) like below:

Get-AzureADGroupMember -ObjectId <Group_ObjectID>

Response:

enter image description here

Reference:

New-AzureADMSGroup (AzureAD) | Microsoft Docs

Related