Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

seeing all job titles and memberof groups for all user in particular OU

2 views
Skip to first unread message

phre...@hotmail.com

unread,
Oct 27, 2009, 3:35:41 PM10/27/09
to
As my subject states, this is what I'm trying to do. I can get the
script to work for it to just show the job title but I'm trying to
also have it list the memberof groups for each job title as well. not
grouped together(though that would be awesome but way out of my
league). just job title and in subsequest columns I would guess it
would list each group that person(who doesn't need to be listed) is a
part of. This is mainly to determine a baseline for a specific job
title and what groups it should start out being a part of. here's what
I have so far. If I take out line 4, it runs and shows the job titles.
once I throw in like 4, the csv file is empty. any help would be much
appreciated.

$OU = "mydomain/myOU"
Get-QADUser -Searchroot $OU -Enabled `
| Select-Object -property 'title' `
| Get-QADMemberOf -Identity $OU `
| Export-Csv "C:\title.csv"

RichS [MVP]

unread,
Nov 7, 2009, 5:49:01 PM11/7/09
to
One thing that springs to mind is that you are trying to do a couple of
things in your pipeline that don't really go together.

This bit

$OU = "mydomain/myOU"
Get-QADUser -Searchroot $OU -Enabled `
| Select-Object -property 'title'

is OK and will produce a list of job titles for every user in your OU.


This bit

| Get-QADMemberOf -Identity $OU `

won't work because to are using the OU as the identity rather than a user.
OUs can't be memebrs of groups

$OU = "mydomain/myOU"
Get-QADUser -Searchroot $OU -Enabled `

| Get-QADMemberOf | Export-Csv "C:\title.csv"

should give you a list of group memberships for each user.

If you want title as well you probably need to do something like


$OU = "mydomain/myOU"
Get-QADUser -Searchroot $OU -Enabled `

| Select-Object -property 'title', memberof | Export-Csv "C:\title.csv"

I think the user property that shows the group memebrships is memberof

Check it and try

--
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


"phre...@hotmail.com" wrote:

> .
>

0 new messages