Select only 25 Active Emails as CSV

10:04 am Uncategorized

$mail = @(); $teachers = Get-ADUser -filter { mail -like "*@localdomain.com" } -Properties mail | ? { $_.Enabled -eq $True } | select mail | select -First 25 | % { $mail += $_.mail }; $mail -join "," | clip
$mail = @(); $teachers = Get-ADUser -filter { mail -like "*@localdomain.com" } -Properties mail | ? { $_.Enabled -eq $True } | select mail | select -First 25 -Skip 25 | % { $mail += $_.mail }; $mail -join "," | clip
etc.

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.