Discussion:
Remove WindowsEmailAddress?
(too old to reply)
Karl Mitschke
2008-01-16 23:07:58 UTC
Permalink
Hello;

I am running Exchange 2007, SP1, and I am trying to clear the WindowsEmailAddress
after (or even before) disabling a mailbox.

Disabling it seems to remove the PrimarySMTPAddress, but not the WindowsEmailAddress.

I DON'T want to delete the AD account, all I want to do is remove its WindowsEmailAddress.

I tried set-mailbox -identity "identity" -WindowsEmailAddress $null" which
fails as $null is not a valid smtp address.

I suppose I could do a call to Active Directory, but I'd prefer not to.

Does anyone have any ideas?

Kar
Shay Levi
2008-01-17 08:30:29 UTC
Permalink
You can clear it with Quest's AD cmdlets:

Set-QADObject -Identity user -objectAttributes @{mail=""}



-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Post by Karl Mitschke
Hello;
I am running Exchange 2007, SP1, and I am trying to clear the
WindowsEmailAddress after (or even before) disabling a mailbox.
Disabling it seems to remove the PrimarySMTPAddress, but not the WindowsEmailAddress.
I DON'T want to delete the AD account, all I want to do is remove its WindowsEmailAddress.
I tried set-mailbox -identity "identity" -WindowsEmailAddress $null"
which fails as $null is not a valid smtp address.
I suppose I could do a call to Active Directory, but I'd prefer not to.
Does anyone have any ideas?
Karl
Karl Mitschke
2008-01-17 15:18:14 UTC
Permalink
Hello Shay,
Post by Shay Levi
-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Post by Karl Mitschke
Hello;
I am running Exchange 2007, SP1, and I am trying to clear the
WindowsEmailAddress after (or even before) disabling a mailbox.
Disabling it seems to remove the PrimarySMTPAddress, but not the WindowsEmailAddress.
I DON'T want to delete the AD account, all I want to do is remove its
WindowsEmailAddress.
I tried set-mailbox -identity "identity" -WindowsEmailAddress $null"
which fails as $null is not a valid smtp address.
I suppose I could do a call to Active Directory, but I'd prefer not to.
Does anyone have any ideas?
Karl
Shay;

I should have mentioned that we won't be installing the Quest AD cmdlets
on our Exchange servers, where my scripts run.

Looks like I will just do it with good old fashioned code.

Thanks

Kar
John Fullbright
2008-02-10 02:06:21 UTC
Permalink
For a user object in ad, it's the mail attribute

in vbscript, something like

objUser.Put "mail", ""
objUser.setinfo

The "old fashioned way"
Post by Karl Mitschke
Hello;
I am running Exchange 2007, SP1, and I am trying to clear the
WindowsEmailAddress after (or even before) disabling a mailbox.
Disabling it seems to remove the PrimarySMTPAddress, but not the WindowsEmailAddress.
I DON'T want to delete the AD account, all I want to do is remove its WindowsEmailAddress.
I tried set-mailbox -identity "identity" -WindowsEmailAddress $null" which
fails as $null is not a valid smtp address.
I suppose I could do a call to Active Directory, but I'd prefer not to.
Does anyone have any ideas?
Karl
Karl Mitschke
2008-02-11 16:20:36 UTC
Permalink
Hello John,
Post by John Fullbright
For a user object in ad, it's the mail attribute
in vbscript, something like
objUser.Put "mail", ""
objUser.setinfo
The "old fashioned way"
Post by Karl Mitschke
Hello;
I am running Exchange 2007, SP1, and I am trying to clear the
WindowsEmailAddress after (or even before) disabling a mailbox.
Disabling it seems to remove the PrimarySMTPAddress, but not the WindowsEmailAddress.
I DON'T want to delete the AD account, all I want to do is remove its
WindowsEmailAddress.
I tried set-mailbox -identity "identity" -WindowsEmailAddress $null"
which fails as $null is not a valid smtp address.
I suppose I could do a call to Active Directory, but I'd prefer not to.
Does anyone have any ideas?
Karl
Thanks, John;

As Garth (Wayne's World) would say, "Get with the now" ;)

No, seriously, I was going to do this wia calls to AD, but since we upgraded
to SP1 the mail attribute changes and deletes as expected (unless I DID code
this in my sleep, and forgot about it)

Karl

Loading...