![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Get Group Membership for a User On Jan 30, 10:06 pm, LE2 Strat <LE2St...@xxxxxx> wrote:
$strUser.memberof -aleksandar http://powershellers.blogspot.com | ||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Get Group Membership for a User Do you want this recursive (i.e. do you want to see every group that the user belongs to through direct and indirect membership)? Or do you only need to know what groups the user is a direct member of? Also, are you concerned about dynamic query-based DLs (which won't show up in the .memberOf property) or just regular security and distribution groups? -- Kirk Munro [MVP] Poshoholic http://www.poshoholic.com "LE2 Strat" <LE2Strat@xxxxxx> wrote in message news:40C1F55B-F5C5-429C-B420-3102ED4D6252@xxxxxx
| ||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Get Group Membership for a User Just the groups that the user is a direct member of (If that group is nested inside another group, I don't see to see that informaiton). Just the security/distributions groups a member is directly a member of. "Kirk Munro [MVP]" wrote:
| ||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Get Group Membership for a User Ok, then Alexandair's approach should give you what you want. If you want more than just the distinguished names of those groups, you can pipe the memberOf list to Get-QADGroup, like this: $user = Get-QADUser 'Poshoholic' $user.memberOf | Get-QADGroup This will take each of the distinguished names in memberOf and pass them along the pipeline to Get-QADGroup one at a time. Get-QADGroup accepts a distinguished name of a group as input, so this allows it to retrieve the actual AD group object with all of it's properties. Note that you will only see three properties in the output of this script: name, type and dn. If you want to see all properties that are available, you can do this: $user.memberOf | Get-QADGroup | Format-List * | more Note that this will generate a lot of output. -- Kirk Munro Poshoholic http://www.poshoholic.com "LE2 Strat" <LE2Strat@xxxxxx> wrote in message news 94B48E1-3FF7-4E35-8940-FE8B3FBDED11@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get group membership | David Arro | PowerShell | 2 | 6 Days Ago 10:47 AM |
| output group membership on a single line | Steven | PowerShell | 4 | 05-27-2008 02:59 PM |
| Group Membership | Don D | Vista mail | 0 | 09-15-2007 09:31 AM |
| ADSI and group membership - what am I doing wrong | Neil Chambers | PowerShell | 5 | 07-14-2007 04:36 AM |
| Enumerating group membership & ADSI | CrazyKiwi | PowerShell | 7 | 07-05-2007 07:42 PM |