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

Trying to get a list of users without an X500 address

$
0
0

Hi

I am trying to get a list of users who do not have an X500 address. All the users have an SMTP address, but need an X500 address in order for them to appear as contacts in another domain in another forest using the galsync method.

I managed to find a script which will display users with an SMTP address, and this seems to work. Same with displaying users with an X500 address. When I try to modify it so that it only displays users without an X500 address, it either displays nothing or it moans about the command I used.

Here is the script:

Get-Mailbox | Select-Object DisplayName,UserPrincipalName,@{Name="EmailAddresses";Expression={$_.EmailAddresses |Where-Object {$_ !(-LIKE) "SMTP:*"}}} | Sort | Export-Csv "C:\Users\$env:username\Desktop\test.csv"

Could someone help? I am not an expert in scripting, but I am learning. Slowly.

Any help will be gratefully received.

Anthony


Viewing all articles
Browse latest Browse all 6937

Trending Articles