Your PowerGUI Community: Simplify your PowerShell related GUI and script editing needs.


Find all Groups that are mail enabled and are not Universal groups.

This question is not answered

Hello,

I have been tasked with finding all groups that are mail enabled and are not universal groups.

I can't figure out the switch to use to find if the group is mail enabled.


This is the command I have developed: Get-QADGroup -GroupType Security ; Distribution -LdapFilter "(email=*)"

But the above command does not return if it is mail enabled. I also want it to query both security and distribution.


I'll then need to set the Security, Distribution groups to Universal from this query.


Thanks,

All Replies
  • This should do it, remove -whatIf to change the group scope.

    Get-QADGroup -SizeLimit 0 -LdapFilter '(mail=*)' | Where-Object {$_.GroupType -match 'Security|Distribution' -and $_.GroupScope -ne 'Universal'} | Set-QADGroup -GroupScope Universal
  • Thank you very much.