itmti
asked on
Exchange 2013 - powershell script to find users with specific domain missing from them
Hi,
We cannot enable Automatically update all users to have email policy applied as some have to be managed manually.
Looking for help for powershell script to export users that are missing specific domain in their address list.
Any suggestions?
We cannot enable Automatically update all users to have email policy applied as some have to be managed manually.
Looking for help for powershell script to export users that are missing specific domain in their address list.
Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You didn't remove the wildcard before the @ symbol, correct?
ASKER
no, all stayed same just modified domain.com with proper domain and destination drive for csv
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
errors
[PS] C:\>Get-Recipient -resultsize unlimited | Where {($_.EmailAddresses -le "*@domain.com")} | select name,alias,primarysmtpaddress | ft -wrap -autosize | out-file c:\Users-without-domain.csv
Where : Could not compare "x500:/o=ExchangeLabs/ou=Exchange Administrative Group (FYD111111)/cn=Recipients/cn=group9e285d0f" to "*@domain.com". Error: "Unable to cast objectof type 'Microsoft.Exchange.Data.SmtpProxyAddress' to type 'Microsoft.Exchange.Data.CustomProxyAddress'."
At line:1 char:39
+ Get-Recipient -resultsize unlimited | Where {($_.EmailAddresses -le "*@domain. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Where-Object], RuntimeException
+ FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.Commands.WhereObjectCommand
[PS] C:\>
Need to replace the @domain.com with the actual name of the domain alias that is missing from the others. For example if the alias should end in @gmail.com, then that is what the @domain.com part should be.
ASKER
yes its replaced, im just not pasting my script here as we dont want to expose company information.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ok, I thought so...just making sure. It looks like you are testing this in a lab. If so, do you have the domain you are looking for added as an Accepted Domain?
ASKER
We need help to export users that are missing @domain.com
Any suggestions?
Thanks