Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

I am trying to find all users that have a valid email.

$
0
0
# Get-ADUser -filter "msExchUserAccountControl -eq '0'" | Select-Object SamAccountName | Export-CSV -Delimiter `t -NoTypeInformation -Path "c:\files\MAILAR.csv"
#Get-ADUser -filter "msExchShadowProxyAddresses -like 'Microsoft.ActiveDirectory.Management.ADPropertyValueCollection'" -Property msExchShadowProxyAddresses | Select-Object SamAccountName | Export-CSV -Delimiter `t -NoTypeInformation -Path "c:\files\MAILAR.csv"
Get-ADUser -filter * -Properties * | Where-Object { $_.msExchShadowProxyAddresses -ne $null } | Select-Object SamAccountName | Export-CSV -Delimiter `t -NoTypeInformation -Path "c:\files\MAILAR.csv"
I have tried several attributes. 
msExchUserAccountControl  seems to be promising.  It get a number close to the email users.

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>