none
Get-ADGroupMember runing issue RRS feed

  • Question

  • Hi guys

    I am just trying some basic AD scripts, but got some problem with Get-ADGroupMember

    I am trying to get a list of users in a group, including every subgroup in that group. Then I want to display samaccountname, Full Name and group they are in.

    Tried to run some basic command 

    import-module activedirectory

    Get-ADGroupMember "Domain Admins" -recursive | Select-Object Name,samaccountname

    When executed, I get this:

    Get-AdGroupMember : A parameter cannot be found that matches parameter name 'recursive'.
    At E:\scripts\testAD.ps1:2 char:35
    + Get-ADGroupMember "Domain Admins" -recursive | Select-Object Name,samaccountname
    +                                   ~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Get-AdGroupMember], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Get-AdGroupMember

    How do I get it to work? Using PS 3

    • Moved by Bill_Stewart Monday, November 3, 2014 4:08 PM Abandoned
    Friday, September 26, 2014 6:30 AM

All replies

  • Hi,

    I'm not getting the error you do, but you can try the Quest AD powershell module.

    http://www.quest.com/powershell/activeroles-server.aspx

    if((get-pssnapin "Quest.ActiveRoles.ADManagement" -erroraction SilentlyContinue) -eq $null)
      {add-pssnapin "Quest.ActiveRoles.ADManagement"}

    Get-qadgroupmember "domain admins" -indirect | select-object name,samaccountname

    Hope this helps.

    Regards,

    Calin

    Friday, September 26, 2014 7:16 AM
  • Trying to avoid using quest modules, as then I would have to get it on every PC that will execute the script
    Friday, September 26, 2014 7:34 AM
  • The CmdLet works fine on any system I have ever used it on.  There is no reason it won't work other than a damaged installation.


    ¯\_(ツ)_/¯

    Friday, September 26, 2014 12:57 PM
  • I have also never experienced problems with Get-ADGroupMember, or the -Recursive parameter.

    Richard Mueller - MVP Directory Services

    Friday, September 26, 2014 2:14 PM