I have created this script and it works great.
Get-ADUser -SearchBase "OU=Accounts,OU=toplevel,DC=mydomain,DC=edu” -Filter 'enabled -eq $true' -Properties * | Select-Object -Property SamAccountName, DisplayName,GivenName,OtherName,Surname,EmailAddress,Title,Department,OfficePhone,Fax,MobilePhone | Sort-Object -Property Name | ConvertTo-CSV > c:\users\shelby\desktop\output.csv -notypeinformation
I need to add to the following script a filter that looks for mail=*xyz.org or mail=*xyz.com or mail=xyz.edu and if any of those email addresses exist then send output to the csv file. Can anyone give me an example on how to do this? I am really confused on how to setup multiple filters.