Create a notepad file and copy the email address to a file C:\temp\list1.txt
$list1 = Get-Content C:\temp\list1.txt
foreach($i in $list1){
Get-ADObject -Filter {(mail -like $i)} |
Select-Object name, objectclass,DistinguishedName |
Export-Csv c:\temp\ADObjectList.csv -Append -NoTypeInformation
}
No comments:
Post a Comment