Was trying to get a list of adusers yesterday but I think I actually need mailusers. I am trying to find everyone not in the 'no internet mail' distribution group. We will review this monthly going forward and be limiting those users that have no business need for email.
Here is what I have so far: $groups = 'No Internet Mail' $types = 'UserMailbox' $notpresent = @() $ourset = @{} foreach ($group in $groups) { $members = (get-Group $group ).members foreach ($member in $members) { if ( !$ourset.contains($member.distinguishedname) ) { $ourset.($member.distinguishedname) = $true } } } get-recipient -ResultSize Unlimited | foreach { if ( !$ourset.contains($_.distinguishedname) ) { $notpresent += $_ } } $notpresent | select * | export-csv "c:\tmp\notmemberofanygroup.csv" -notype This is getting me good data with the exception that it is getting me other recipienttypes other than just usermailbox. Is there a way to add recipienttype = usermailbox to this script? David McSpadden System Administrator Indiana Members Credit Union P: 317.554.8190 [Description: Description: imcu email icon]<http://imcu.com/> [Description: Description: facebook email icon] <https://www.facebook.com/IndianaMembersCU> [Description: Description: twitter email icon] <https://twitter.com/IndMembersCU> [Description: Description: email logo] [http://www.amuletsolutions.com/images/mcp.gif]<http://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwjFztf-tePJAhXK5iYKHcPtAxEQjRwIBw&url=http://www.amuletsolutions.com/awards.aspx&bvm=bv.110151844,d.amc&psig=AFQjCNHkrx8CednTEOOq4zUxYyrRUGzUsg&ust=1450459757284499> This e-mail and any files transmitted with it are property of Indiana Members Credit Union, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Please consider the environment before printing this email.