Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - seeing all job titles and memberof groups for all user in particularOU

Reply
 
Old 4 Weeks Ago   #1 (permalink)
phreakers


 
 

seeing all job titles and memberof groups for all user in particularOU

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"




My System SpecsSystem Spec
Old 3 Weeks Ago   #2 (permalink)
RichS [MVP]


 
 

RE: seeing all job titles and memberof groups for all user in particul

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


"phreakers@newsgroup" wrote:
Quote:

> 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"
>
>
>
> .
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Adding a user to groups via dsadd VB Script
AD: Looking for user not in a groups PowerShell
Scripting user creation. BUT How to add to groups..... VB Script
remove user from all groups but 1 PowerShell
User Groups in Vista Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46