Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community

missing MembershipRule in Get-AzureADMSGroup

Brass Contributor

I am using AzureAD module in version 2.0.2.118 and when I execute the command 

get-azureadmsgroup -Id 34298b62-bdb4-489b-9569-d3ad90af5d53|fl

I got only the following parameters:

Id                           : 34298b62-bdb4-489b-9569-d3ad90af5d53
OdataType                    : 
Description                  : 
OnPremisesSyncEnabled        : 
DisplayName                  : Group_name
OnPremisesLastSyncDateTime   : 
Mail                         : 
MailEnabled                  : False
MailNickname                 : acecce91-366d-4043-8c0c-4c8e54e26203
OnPremisesSecurityIdentifier : 
ProxyAddresses               : {}
SecurityEnabled              : True
GroupTypes                   : {DynamicMembership}
Visibility                   : 
CreatedDateTime              : 24.04.2019 13:06:17
RenewedDateTime              : 24.04.2019 13:06:17

Cannot get the MembershipRule property. 

Any tips or tricks on how to get it?

7 Replies

You need to use the AzureADPREVIEW module for this.

@Vasil Michev Thank you Vasil, 

 

Can someone from Microsoft tell, why it is on the official documentation page which refers to AzureAD Powershell 2.0 cmdlet?  

 

Michal_Z_0-1610653838891.png

 

I have the same problem, even with AzureADPreview

2.0.2.128 AzureAD
2.0.2.129 AzureADPreview

@PlasmatikSteak 

 

If you have both modules installed it will default to the first one in the list being AzureAD. 

 

Your options are:

1. Uninstall-Module AzureAD

2. Prefix the Module Name to the command. AzureADPreview\Set-AzureADMSGroup

@SigarProc 

This was working... but now it is not.

AzureAD\Get-AzureADMSGroup or AZureADPreview\Get-AzureADMSGroup

With latest modules for either AzureAD (2.0.2.140) or AZureADPreview (2.0.2.138) for Dynamic Groups we once again (it was there in some previous builds) no longer see the following in the out:

MembershipRule
MembershipRuleProcessingState

 

@Vasil Michev 

Hello, works like a charme. Thanks

 

@Michal_Z 

I know this is an old topic but I recently encountered this issue, here's the steps I took to get membershiprule:

  • launch PowerShell as admin
  • Uninstall AzureADPreview

 

uninstall-module -name azureadpreview

 

  • Install AzureADPreview version 2.0.2.62

 

install-module azureadpreview -requiredversion 2.0.2.62

 

  • verify the correct version is installed

 

get-installedmodule -name azureadpreview

 

  • run your commands prefixed with the module name

 

AzureADPreview\connect-azuread
AzureaADPreview\get-azureadmsgroup -All $true | select displayname, membershiprule