The script below was written to add about 1000 user that fit a certain criteria into a group. You could use any field of Get-Mailbox to sort, and this script filters out disabled accounts. To run this script you need to load PSSnapin Exchange and Quest

$users = Get-Mailbox -ResultSize Unlimited | ?{$_.CustomAttribute1 -eq “Phoenix” -and $_.UserAccountControl -notlike “*AccountDisabled*”} | Select GUID
Foreach($user in $users)
{
    Add-qadgroupmember –Identity “CN=WirelessUsers,OU=Groups,DC=mydomain,DC=internal” –Member $user.GUID.ToString()
}