![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | List all Group Users in AD I'm having problems (most of which are being new to powershell!) in grabbing a list of all groups-users in a domain. I have played a bit w/ Quest's Active Directoy cmdlets and came up w/ the following: get-qadgroup | foreach-object {get-qadgroupmember ($_)} This, techncially does what it is suppose to do.... For every group, it lists the members. But, the problem is, it doesn't state the group name!! I simple need to get a dump from AD off all group and memberships. Thanks! |
My System Specs![]() |
| | #2 (permalink) |
| | RE: List all Group Users in AD I haven't got access to an AD to test it but I think that all you need to do is make a slight modification get-qadgroup | foreach-object { "`nGroup: $($_.name)" get-qadgroupmember ($_) } If name doesn't work try distinguishedname -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Chris" wrote: Quote: > I'm having problems (most of which are being new to powershell!) in grabbing > a list of all groups-users in a domain. > > I have played a bit w/ Quest's Active Directoy cmdlets and came up w/ the > following: > get-qadgroup | > foreach-object {get-qadgroupmember ($_)} > > This, techncially does what it is suppose to do.... For every group, it > lists the members. But, the problem is, it doesn't state the group name!! > > I simple need to get a dump from AD off all group and memberships. > > Thanks! |
My System Specs![]() |
| | #3 (permalink) |
| | RE: List all Group Users in AD Awesome. I'm almost there I think.... I figured it was my lack for formatting output that was the hiccup......(again, I'm new ..)But, how would you state the group per line rather than all in one column? So, it would like similar... Domain Admin, Chris Domain Admin, Joe SQL_Group, Al SQL_Group,Chris Blah,blah ![]() Thanks again for the help!!! "RichS [MVP]" wrote: Quote: > I haven't got access to an AD to test it but I think that all you need to do > is make a slight modification > > get-qadgroup | foreach-object { > "`nGroup: $($_.name)" > get-qadgroupmember ($_) > } > > If name doesn't work try distinguishedname > > -- > Richard Siddaway > All scripts are supplied "as is" and with no warranty > PowerShell MVP > Blog: http://richardsiddaway.spaces.live.com/ > PowerShell User Group: http://www.get-psuguk.org.uk > > > "Chris" wrote: > Quote: > > I'm having problems (most of which are being new to powershell!) in grabbing > > a list of all groups-users in a domain. > > > > I have played a bit w/ Quest's Active Directoy cmdlets and came up w/ the > > following: > > get-qadgroup | > > foreach-object {get-qadgroupmember ($_)} > > > > This, techncially does what it is suppose to do.... For every group, it > > lists the members. But, the problem is, it doesn't state the group name!! > > > > I simple need to get a dump from AD off all group and memberships. > > > > Thanks! |
My System Specs![]() |
| | #4 (permalink) |
| | RE: List all Group Users in AD Try this $names = @() Get-QADGroup | ForEach-Object { $temp = "`n$($_.Name): " if ($_.member -ne $null) { foreach ($user in $_.member){ $un = $user.Split(",") $temp += $un[0].Replace("CN=","") + ", " } $names += $temp.TrimEnd(", ") } else {$names += ($temp + "No members")} } $names -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Chris" wrote: Quote: > Awesome. I'm almost there I think.... I figured it was my lack for > formatting output that was the hiccup......(again, I'm new ..)> > But, how would you state the group per line rather than all in one column? > So, it would like similar... > Domain Admin, Chris > Domain Admin, Joe > SQL_Group, Al > SQL_Group,Chris > Blah,blah > ![]() > > Thanks again for the help!!! > > > > > "RichS [MVP]" wrote: > Quote: > > I haven't got access to an AD to test it but I think that all you need to do > > is make a slight modification > > > > get-qadgroup | foreach-object { > > "`nGroup: $($_.name)" > > get-qadgroupmember ($_) > > } > > > > If name doesn't work try distinguishedname > > > > -- > > Richard Siddaway > > All scripts are supplied "as is" and with no warranty > > PowerShell MVP > > Blog: http://richardsiddaway.spaces.live.com/ > > PowerShell User Group: http://www.get-psuguk.org.uk > > > > > > "Chris" wrote: > > Quote: > > > I'm having problems (most of which are being new to powershell!) in grabbing > > > a list of all groups-users in a domain. > > > > > > I have played a bit w/ Quest's Active Directoy cmdlets and came up w/ the > > > following: > > > get-qadgroup | > > > foreach-object {get-qadgroupmember ($_)} > > > > > > This, techncially does what it is suppose to do.... For every group, it > > > lists the members. But, the problem is, it doesn't state the group name!! > > > > > > I simple need to get a dump from AD off all group and memberships. > > > > > > Thanks! |
My System Specs![]() |
| | #5 (permalink) |
| | Re: List all Group Users in AD Hello chris, Here's another way (one line): PS > Get-QADGroup -sizeLimit 0 | select @{name="GroupName";expression={$_.name}} -expand members | select GroupName,@{n='Member';e={ (Get-QADObject $_).name }} GroupName Member --------- ------ Group1 User1 Group1 User1 Group2 User2 Group2 User2 Group3 User3 Group3 User3 --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic c> I'm having problems (most of which are being new to powershell!) in c> grabbing a list of all groups-users in a domain. c> c> I have played a bit w/ Quest's Active Directoy cmdlets and came up w/ c> the c> following: c> get-qadgroup | c> foreach-object {get-qadgroupmember ($_)} c> This, techncially does what it is suppose to do.... For every group, c> it lists the members. But, the problem is, it doesn't state the c> group name!! c> c> I simple need to get a dump from AD off all group and memberships. c> c> Thanks! c> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| list users, NOT members of a group | PowerShell | |||
| Problem copying list of contacts into a new group list | Vista mail | |||
| No users in Local Administrators Group | Vista security | |||
| Re: List all Group Users in AD | PowerShell | |||
| list users in a local group on a distant computer | PowerShell | |||