New-AzureADMSGroup fail

Welcome Forums General PowerShell Q&A New-AzureADMSGroup fail

Viewing 4 reply threads
  • Author
    Posts
    • #253409
      Participant
      Topics: 1
      Replies: 2
      Points: 42
      Rank: Member

      I have a problem with this cmdlet: New-AzureADMSGroup. When I try to run the next error message come up:

      “New-AzureADMSGroup : A parameter cannot be found that matches parameter name ‘MembershipRule’.
      At line:1 char:216
      + … XXXXXXXX” -GroupTypes “DynamicMembership” -MembershipRule “(user. …
      + ~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidArgument: (:) [New-AzureADMSGroup], ParameterBindingException
      + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Open.MSGraphV10.PowerShell.NewMSGroup”

      I’m not frequently using this cmdlet, and I know this is a Public Preview so not a stable version. Do you know anything about this problem? Maybe am I misspell something that I can’t see? Or, is the cmdlet changed?

      Thank you for any help

    • #253559
      Participant
      Topics: 13
      Replies: 1753
      Points: 3,136
      Helping Hand
      Rank: Community Hero

      No code was posted, so it is difficult to tell. Based on the documentation, there is a MembershipRule parameter, the first thought is that it could be in a parameterset depending on the other parameters that were passed to the cmdlet.

    • #253703
      Participant
      Topics: 1
      Replies: 2
      Points: 42
      Rank: Member

      I have tried it with a test group according to its doc page:

      New-AzureADMSGroup -DisplayName “TestGroup1” -Description “Test group for powershell.org” -MailEnabled $False -MailNickname “test” -SecurityEnabled $True -GroupTypes “DynamicMembership” -MembershipRule “(user.objectId -ne null)” -MembershipRuleProcessingState “On”

      the error message was:

      New-AzureADMSGroup : A parameter cannot be found that matches parameter name ‘MembershipRule’.
      At line:1 char:187
      + … Enabled $True -GroupTypes “DynamicMembership” -MembershipRule “(user. …
      + ~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidArgument: (:) [New-AzureADMSGroup], ParameterBindingException
      + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Open.MSGraphV10.PowerShell.NewMSGroup

      the user.objectId -ne null is working if I write it directly to the Azure portal and even if I change it to something else it doesn’t work.

    • #253706
      Participant
      Topics: 1
      Replies: 2
      Points: 42
      Rank: Member

      I have tried it with a test group according to its doc page:

      New-AzureADMSGroup -DisplayName “TestGroup1” -Description “Test group for powershell.org” -MailEnabled $False -MailNickname “test” -SecurityEnabled $True -GroupTypes “DynamicMembership” -MembershipRule “(user.objectId -ne null)” -MembershipRuleProcessingState “On”

      the error message was:

      New-AzureADMSGroup : A parameter cannot be found that matches parameter name ‘MembershipRule’.
      At line:1 char:187
      + … Enabled $True -GroupTypes “DynamicMembership” -MembershipRule “(user. …
      + ~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidArgument: (:) [New-AzureADMSGroup], ParameterBindingException
      + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Open.MSGraphV10.PowerShell.NewMSGroup

      the user.objectId -ne null is working if I write it directly to the Azure portal and even if I change it to something else it doesn’t work.

    • #253757
      Participant
      Topics: 0
      Replies: 77
      Points: 343
      Helping Hand
      Rank: Contributor

      If you run Get-Command New-AzureADMSGroup | Select Module* , do you see the correct module listed?

Viewing 4 reply threads
  • You must be logged in to reply to this topic.