From: Jeff on
I'm trying to get the check box that says "Hide From Exchange Address
Lists" checked for about 900 mail contacts in our exchange 2007
system. To select the users, I enter this into powershell:

get-user -filter {WindowsEmailAddress -eq '*@MyCompany.com'}

When I do that, it pulls every user that I am interested in. However,
when I try to pipe that into get-mailcontact, I get an error that says
the user that was piped in can't be found on the domain controller.
I've tried forcing it to different domain controllers and always get
the same result.

Any suggestions for getting around this?

Thanks.
From: Karl Mitschke on
Hello Jeff,

> I'm trying to get the check box that says "Hide From Exchange Address
> Lists" checked for about 900 mail contacts in our exchange 2007
> system. To select the users, I enter this into powershell:
>
> get-user -filter {WindowsEmailAddress -eq '*@MyCompany.com'}
>
> When I do that, it pulls every user that I am interested in. However,
> when I try to pipe that into get-mailcontact, I get an error that says
> the user that was piped in can't be found on the domain controller.
> I've tried forcing it to different domain controllers and always get
> the same result.
>
> Any suggestions for getting around this?
>
> Thanks.
>

Why not use Get-MailContact?

Get-MailContact -filter {WindowsEmailAddress -eq '*@MyCompany.com'} |Set-MailContact
-HiddenFromAddressListsEnabled: $True -whatif


Karl
http://unlockpowershell.wordpress.com/


From: Jeff on
Karl,

Thanks for your reply. I tried just using get-mailcontact and the
syntax you provide works. However(and this is what I find puzzling),
when I use get-mailcontact like you suggest, it doesn't error out, but
I also don't get any results back. However, replacing get-mailcontact
with get-user gives me all of the entries I'm trying to find.

Thanks,
Jeff

On Apr 1, 12:51 pm, Karl Mitschke <karlmitsc...(a)somestate.gov> wrote:
> Hello Jeff,
>
>
>
>
>
> > I'm trying to get the check box that says "Hide From Exchange Address
> > Lists" checked for about 900 mail contacts in our exchange 2007
> > system.  To select the users, I enter this into powershell:
>
> > get-user -filter {WindowsEmailAddress -eq '...@MyCompany.com'}
>
> > When I do that, it pulls every user that I am interested in.  However,
> > when I try to pipe that into get-mailcontact, I get an error that says
> > the user that was piped in can't be found on the domain controller.
> > I've tried forcing it to different domain controllers and always get
> > the same result.
>
> > Any suggestions for getting around this?
>
> > Thanks.
>
> Why not use Get-MailContact?
>
> Get-MailContact  -filter {WindowsEmailAddress -eq '...@MyCompany.com'} |Set-MailContact
> -HiddenFromAddressListsEnabled: $True -whatif
>
> Karlhttp://unlockpowershell.wordpress.com/

From: Rich Matheisen [MVP] on
On Thu, 1 Apr 2010 10:13:13 -0700 (PDT), Jeff <jbrusoe(a)gmail.com>
wrote:

>Thanks for your reply. I tried just using get-mailcontact and the
>syntax you provide works. However(and this is what I find puzzling),
>when I use get-mailcontact like you suggest, it doesn't error out, but
>I also don't get any results back. However, replacing get-mailcontact
>with get-user gives me all of the entries I'm trying to find.

It's unlikely that mail-enabled Contacts will have a primary SMTP
proxy address in one of your domains. They'd have e-mail addresses in
other domains.

FYI, using the WindowsEmailAddress property can be misleading. The
property is named appropriately -- it isn't used by Exchange. You'd do
much better using the PrimarySmtpAddress property.
---
Rich Matheisen
MCSE+I, Exchange MVP
From: Karl Mitschke on
Hello Rich Matheisen [MVP],

> On Thu, 1 Apr 2010 10:13:13 -0700 (PDT), Jeff <jbrusoe(a)gmail.com>
> wrote:
>
>> Thanks for your reply. I tried just using get-mailcontact and the
>> syntax you provide works. However(and this is what I find puzzling),
>> when I use get-mailcontact like you suggest, it doesn't error out,
>> but I also don't get any results back. However, replacing
>> get-mailcontact with get-user gives me all of the entries I'm trying
>> to find.
>>
> It's unlikely that mail-enabled Contacts will have a primary SMTP
> proxy address in one of your domains. They'd have e-mail addresses in
> other domains.
>
> FYI, using the WindowsEmailAddress property can be misleading. The
> property is named appropriately -- it isn't used by Exchange. You'd do
> much better using the PrimarySmtpAddress property.
> ---
> Rich Matheisen
> MCSE+I, Exchange MVP

Yes, I was going to suggst that Jeff run Get-MailContact filtering on PrimarySmtpAddress
instead, but hadn't gotten around to it.

Thanks for helping while I was away :)

When he wrote that it wasn't returning results, I thought it was odd, as
a get-user shows the WindowsEmailAddress for him.

Well, I assume it does, as he says he's filtering on it in Get-User ;)

Karl
http://unlockpowershell.wordpress.com/