Author Posts

September 3, 2015 at 7:00 am

I have users that I want to be able to enter in when prompted and see if they have membership in certain groups, (for example all the groups that have the prefix of HMM, like HMMHome, HMMStart, HMMServe...)

I can use Get-ADPrincipalGroup to do it for a specific user, and I can use Get-ADGroup with a -filter {name -like "HMM*"

but I can't seem to get what I want which is a combination of both of them?!?!

September 3, 2015 at 9:59 am

What about just piping the results of Get-ADPrincipalGroupMembership to Where-Object to limit the results:

Get-ADPrincipalGroupMembership username | Where-Object {$_.name -like "HMM*"}

September 3, 2015 at 11:06 am

Yes, that's exactly what I needed, thnx!