header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
AD user member of
Last Post 23 Mar 2010 03:21 AM by Jazo. 8 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
JazoUser is Offline
New Member
New Member
Posts:58
Avatar

--
02 Feb 2010 01:10 AM
    hi all,
    Could someone help me with a script that did something like this: Query users in a OU and list out the users Display Names and all the groups that the user is Member of?

    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    02 Feb 2010 04:47 AM
    get-qaduser -includedproperties displayName,memberOf -searchroot 'ou=users,ou=location,dc=example,dc=com' -credential 'domain\admin' | select displayName,memberOf | ft -auto

    I tested this out in my environment and found I needed my admin credentials (I don't run my desktop with domain admin credentials). If you are logged in as a user that has been delegated rights to see the memberof property or as a domain admin then you can skip the credential switch. Otherwise you will need to supply your admin credentials to see memberof.

    Also, obviously, you need to change the searchroot parameter to fit your needs.
    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    02 Feb 2010 04:51 AM
    Oh I just realized a feature that I like over the MS AD module for PS. You don't have to supply the OU in distinguishedName format with Quest's tools it can be supplied in canonical format:

    -searchroot 'example.com/location/users'

    Which is much more convenient.

    JazoUser is Offline
    New Member
    New Member
    Posts:58
    Avatar

    --
    04 Feb 2010 01:30 AM
    Thanks cameronove ... :-)
    JazoUser is Offline
    New Member
    New Member
    Posts:58
    Avatar

    --
    18 Mar 2010 03:01 AM
    need some help here again.... when using the | ft -auto or any other format command I know of, the memberof Column always ends with ... at the end. I'm not able to see all the values. Some users are members of maybe 20 groups. I'm only seeing one or two before the ....

    How do i get a list of all????
    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    18 Mar 2010 06:08 AM
    Well you could do something like:

    Get-QADUser username -IncludedProperties memberof | select displayname -ExpandProperty memberof

    JazoUser is Offline
    New Member
    New Member
    Posts:58
    Avatar

    --
    18 Mar 2010 07:58 AM
    great stuff....now we are getting som where.. :-) I'm doing:

    get-qaduser -title 'title' -includedproperties displayName,memberOf -searchroot 'ou=location,ou=location
    ,dc=Name,dc=com' | select displayName -ExpandProperty memberof

    It shows all the groups now but not the displayName. Any advise here???
    cameronoveUser is Offline
    Basic Member
    Basic Member
    Posts:332
    Avatar

    --
    18 Mar 2010 09:47 AM
    Yeah that is a bit challenging.  I noticed that as well.  Here is a work around for display purposes.  It takes away the object but displays nicely.  If you wanted to pass the object further down the pipeline then this work around would be problematic, but it does display what you want...
    get-qaduser $username -IncludedProperties displayname,memberof | %{$_.displayname;"$('-'*$_.displayname.length)";$_.memberof | %{$_}}
    JazoUser is Offline
    New Member
    New Member
    Posts:58
    Avatar

    --
    23 Mar 2010 03:21 AM
    thanks again cameronove..... :-)
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer