Help with output from get-msolgroupmember ; get-msoluser

Hi,

get-msolgroupmember -ID; get-msoluser -city CITY

This returns ALL the information about every member of the group ID that has the city parameter CITY.

How do I get this command to only return for example Display name.

John,
Welcome to the forum. :wave:t4:

Actually these two commands are unrelated to each other. A semikolon is just a way to write two separate commands on one line.

In general we use

to limit the output of a cmdlet to the desired properties.
Please always read the help for the cmdlets you’Re about to use completely including the examples to learn how to use them.

Hi Olaf,

Thank you for your reply.

I’m new at this. How would I get the displaynames of users with a specific parameter from a group?

I think I need to use both msolgroupmember and msoluser, am I wrong?

Without having experiences with this or even access to a tennant to verify at the moment something like this should do the trick actually:

Get-MsolGroupMember -GroupObjectId 'GUID' |
    Where-Object{
        (Get-MsolUser -ObjectId $_.ObjectID).City -eq 'CITY'
    }

In addition to the reason already given why this would not work, the -city parameter is a filter which does not take pipline input.

Olaf’s code does work, I tested it.