combine Get-ADGroupMember and get-QASUnixUser

Hi EE

so I need to pull some group member details but I need to use the get-QASUnixUser CMDLET to get some specific Unix account details .

can someone help me ?

so basically , how do I pull members of a group but also using get-QASUnixUser  to get those Unix account details.
LVL 2
MilesLoganAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LearnctxEngineerCommented:
You will need to pull the membership and either pipe to the Get-QASUnixUser cmdlet like so.

Get-ADGroupMember -r -identity <groupname> | Get-QASUnixUser

Open in new window


Or iterate through the list of returned users and extract the relevant information you are after like so.

ForEach ($Member in @(Get-ADGroupMember -r -identity <groupname>))
{
    ... stuff ....
    Get-QASUnixUser $Member.name
    ... things ...
}

Open in new window

MilesLoganAuthor Commented:
I had already tried and failed -- > Get-ADGroupMember -r -identity <groupname> | Get-QASUnixUser

Thanks ! this does work .. any idea how to only output members of a certain domain ?
So in the group , I have users from more than one domain , how can I narrow it so it only gets the members of XX domain ?

ForEach ($Member in @(Get-ADGroupMember -r -identity <groupname>))
{
    ... stuff ....
    Get-QASUnixUser $Member.name
    ... things ...
}

Open in new window

LearnctxEngineerCommented:
You would need to filter them based on their DN or the SID of the account. You could do this with Regex or wildcards (-match, -like), or using startswith (SID) or endswith (DN) as below.

ForEach ($Member in @(Get-ADGroupMember -r -identity <groupname>))
{
    if ($Member.SID.Startswith((Get-ADDomain -Identity your.domain).DomainSID) ## Or manually enter the start of your domain SID "S-1-5-21-41432690-3719764436-1984117282"
    {
        ... stuff ....
        Get-QASUnixUser $Member.name
        ... things ...
    }
}

Open in new window


Or the DN.

ForEach ($Member in @(Get-ADGroupMember -r -identity <groupname>))
{
    if ($Member.distinguishedname.EndsWith(",DC=Child,DC=Your,DC=Domain"))
    {
        ... stuff ....
        Get-QASUnixUser $Member.name
        ... things ...
    }
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MilesLoganAuthor Commented:
Thank you , both of those tips helped me figure out what I needed .
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.