Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Pull out smtp addresses for each user object

$
0
0

Good Afternoon all,

I have the following line of powershell code but I am getting into a bit of a muddle, I am trying to pull out all SMTP addresses assigned to individual user objects belonging to a specific OU (I want to strip out anything that isn't an SMTP address like X400 or X500 addresses:

Thanks for any help you can (once again) provide me.

Get-ADUser-Filter * -SearchBase '<OU-Location>'-Properties proxyaddresses |Select-Object Name, @{ L ="ProxyAddresses"; E = { $_.ProxyAddresses -join";"|Where-Object { ProxyAddresses-eq"*smtp:*" } } } |Export-Csv-Path"<Path>"–NoTypeInformation

Viewing all articles
Browse latest Browse all 6937

Trending Articles