Solved

get-adgroupmember cmdlet is not working.

Posted on 2014-10-08
5
234 Views
Last Modified: 2014-10-30
I am trying the get-adgroupmember to list members in a domain group but I am getting a message in powershell saying it is not a valid command.  

get-adgroupmember "domain admins" -recursive | ft names

Please advise.
0
Comment
Question by:nav2567
5 Comments
 
LVL 16

Expert Comment

by:Rajitha Chimmani
ID: 40369618
Have you imported the active directory module?

Import-Module ActiveDirectory
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40369673
Raj is correct. If you are not doing this on a domain controller you have to make sure that you have the RSAT Tools installed to have the ActiveDirectory module available as well.

When adding features it is called "AD DS Snap-Ins and Command-Line Tools features"
0
 
LVL 2

Expert Comment

by:Crusadin
ID: 40372643
Try this:

$group = "Domain Admins"
$directorySearcher = New-Object System.DirectoryServices.DirectorySearcher([ADSI]"")
$directorySearcher.Filter = "(&(objectclass=group)(name=$group))"
$directorySearcher.FindAll() | %{$_.Properties.member} | %{([ADSI]([System.String]::Format("LDAP://{0}",$_))).Properties.name}


It doesn't require any snap in and is compatible with DC 2003
0
 

Author Comment

by:nav2567
ID: 40382310
I tried the following command but do not see any members being returned.  Please see the attached and advise.
getmember.png
0
 
LVL 16

Accepted Solution

by:
Joshua Grantom earned 500 total points
ID: 40382315
take the "s" off of names

get-adgroupmember "domain admins" -recursive | ft name

Open in new window

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now