List Group Members in Active Directory

This script can be used to list group membership in Active Directory.

 
 
 
 
 
(44)
14,131 times
Add To Favorites
Active Directory
11/28/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to Ask a Question


  • Any Script to get list of Members from Domain Admin Group
    1 Posts | Last Post February 07, 2013
    • Hi Santhosh,
      
      Am new to powershell script. We have 5 DC's with different domains. Any script to get the members list from domain admin group. Also the result should be stored in remote location and the result sheet would be automatically gets updated whenever user removed or added to that Domain Admin Group. Can you pls help me
  • dsclient
    1 Posts | Last Post November 19, 2012
    • Hi Santhosh
      
      Please can you help. I am trying to locate dsclient for Windows NT4.0 and I unable to find it anywhere.
      
      Thanks and regards
      
      Rob
  • Link to updated code doesnt work!
    1 Posts | Last Post August 01, 2012
    • 
      Hi! Santhosh - this link doesnt work!
      
      You can see an updated/another version of the script in - http://gallery.​technet.microso​ft.com/scriptce​nter/Search-AD-​Collect-Local-9​952be71
  • How to get list of groups as input for this script
    1 Posts | Last Post August 01, 2012
    • Hi! Santhosh, 
      Can you also pl provide the script to generate list of groups? Like I have 20 groups but want to generate users and groups list which belong to only 10 groups. The 10 groups have the last 3 characters common eg : <grpname_xyz>.
      
      Do we need to do any changes to the script you provided - or just copy onto notepad c- change the file name and make sure the groups files exisits and execute. 
      
      Pl assist and many thanks for your article.
      
      Ven
  • Unexpected token 'Uname' in expression or statement
    2 Posts | Last Post February 21, 2012
    • Hi Santosh - Unfortunately I am receiving the error message:
      
      Unexpected token 'Uname' in expression or statement.
      At C:\Scripts\Group_Members_Modified.ps1:15 char:32
      +             $Uname.samaccountname $Uname <<<< .cn ¦ Out-File $GFile -encoding ASCII -append
           + CategoryInfo         ¦ ParserError: (Uname:String) [], ParseException
           + FullyQualifiedErrorId¦ UnexpectedToken
      
      
      Can you help please? :-)
      
      
    • Please post your input file here.
      If you modified the script, post the updated script also.
      
  • Updated/Another version of the script
    3 Posts | Last Post December 21, 2011
    • You can see an updated/another version of the script in - http://gallery.technet.microsoft.com/scriptcenter/Search-AD-Collect-Local-9952be71
    • WORKS !!! WORKS !!! WORKS !!! WORKS !!! :-) THKS
    • Thanks!
  • New to Powershell
    9 Posts | Last Post December 12, 2011
    • Hi Santhosh,
      I am new to powershell. How do you run this script? do you copy it to a file and run the file? what should be the file extension be? . ps ?
      
      
      Harsh
    • Copy the script and paste it into  Notepad.  Save this file with .PS1 extension.  You can run this script from a PoweShell Window (not Command Prompt).
      You can read more about PowerShell in the following links:
      http://technet.microsoft.com/en-us/library/bb978526.aspx
      https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US
    • Do you have a solution where group members exceed 5000? Everywhere I've searched I run into the .PageSize property, which I used in VBS and worked wonderfully, but doesn't work apparently in PowerShell.
      
      As a consequence, I can't get your script to run, because the group I'm running against has 5,433 users in it.
      
      Thanks,
    • You can use Pagesize in PowerShell also.  Here is an example:
      
      http://portal.sivarajan.com/2010/08/search-users-from-2-ad-domains-using.html
      
    • Great instructions! Thank you!
    • Thanks Ed!
    • I think you need to use ADO Range Limits to retrieve more than 1500 DN's in the member attribute. I've done this in VBScript, I'm attempting to adapt to PowerShell.
    • Good point Richard.  Let me see if can test the script against a group with has more than 1500 members.  
    • This example shows how to use range retrieval to list more than 1500 members in a group:
      http://gallery.technet.microsoft.com/List-Members-of-Large-Group-0eea0132
      Also, the Get-ADGroupMember module handles large groups.
  • Updated Script
    4 Posts | Last Post November 11, 2011
    • You can see an updated script in the following link:
      
      http://gallery.technet.microsoft.com/scriptcenter/a1672a07-76d7-43d2-8c19-43913bd6b7c2
      
    •  z
    • Thanks for following up and making these updates!
    • Thanks for the feedback Ed.
  • Nested Groups
    2 Posts | Last Post October 15, 2011
    • This script doesn't appear to recursively enumerate users in nested groups.
    • That is correct.  I haven’t included that option in this version.  I will post the updated version to support Nested Group soon. 
      Thanks for the feedback.