Powershell question - property to determine group vs user, using Quest Get-QADUser

2012-10-05 Thread Michael Leone
I'm confused about something. I am writing a Powershell script, using the Quest AD CMDLETs. I have a list of groups that I need to retrieve the membership list for. But I don't want any group members that are themselves groups (i.e., no nested groups); I only want users. And I am not sure how best

Re: Powershell question - property to determine group vs user, using Quest Get-QADUser

2012-10-05 Thread Steven Peck
This will get only user type objects Get-QADGroupMember $GroupName -type 'user' This will get only user type objects AND users from any nested groups. Get-QADGroupMember $GroupName -type 'user' -indirect So if the rest of your script currently works that should be the only change you have to

Re: Powershell question - property to determine group vs user, using Quest Get-QADUser

2012-10-05 Thread Rob Bonfiglio
I think this should work for you: $TheUsers = Get-QADGroupMember $GroupName | where {$_.type -eq 'user'} | Select Name | Sort Name On Fri, Oct 5, 2012 at 11:36 AM, Michael Leone oozerd...@gmail.com wrote: I'm confused about something. I am writing a Powershell script, using the Quest AD

Re: Powershell question - property to determine group vs user, using Quest Get-QADUser

2012-10-05 Thread Steven Peck
So... $TheUsers = Get-QADGroupMember $GroupName -type 'user' At this moment you have the user objects and their properties so let's try $TheUsers | Get-Member Looking at the Properties field there is a AccountIsDisabled property.. yay. Lot's of other properties as well which is nice since you

Re: Powershell question - property to determine group vs user, using Quest Get-QADUser

2012-10-05 Thread Michael Leone
On Fri, Oct 5, 2012 at 12:15 PM, Steven Peck sep...@gmail.com wrote: So... $TheUsers = Get-QADGroupMember $GroupName -type 'user' At this moment you have the user objects and their properties so let's try Yes, but that's not all I want. I *do* want to see any groups that are members of

Re: Powershell question - property to determine group vs user, using Quest Get-QADUser

2012-10-05 Thread Michael Leone
On Fri, Oct 5, 2012 at 2:14 PM, Michael Leone oozerd...@gmail.com wrote: On Fri, Oct 5, 2012 at 12:15 PM, Steven Peck sep...@gmail.com wrote: So... $TheUsers = Get-QADGroupMember $GroupName -type 'user' At this moment you have the user objects and their properties so let's try Yes, but