powershell - Search members in Group Distribution Exchange -
i'm using following code members in group.
get-distributiongroupmember -identity "marketing usa" the problems is, of groups have more 1000 members. instead of loading records, there better way can filter result see members need.
i search primary email , display name.
my exchange versions 2010 , 2013.
for both exchange 2010 , 2013 can search email address creating list of email addresses in regex form separated |. use -imatch match email addresses need. note: search both primary , secondary address.
$emailaddress = [regex]"username1@domain.com|username2@domain.com|username3@domain.com" get-distributiongroupmember -identity "marketing usa" | { $_.emailaddresses.smtpaddress -imatch $emailaddress } then searching display name can use regex in same way separating names |.
$displayname = [regex]"firstname1 lastname1|firstname2 lastname2|firstname3 lastname3" get-distributiongroupmember -identity "marketing usa" | { $_.displayname -imatch $displayname } with method of filtering can partial searches. if put in first name of user users name. same goes email address search.
Comments
Post a Comment