get-contact -identity "domain.com/Users/Test Contact" | foreach {
enable-mailcontact -ExternalEmailAddress $_.WindowsEmailAddress }
The WindowsEmailAddress attribute has a valid SMTP address but the command
fails with the following message:
Enable-MailContact : Cannot bind parameter 'ExternalEmailAddress'. Cannot
convert "test.c...@domain.com" to "Microsoft.Exchange.Data.ProxyAddress".
There isn't much information on Microsoft.Exchange.Data.ProxyAddress other
than it is looking for a SMTP address which I believe I have supplied it.
Anyone here have any ideas on the error or another approach?
Correct me If I'm wrong, if the contact has an WindowsEmailAddress value
then isn't it already enabled?
---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar
R> Hello - I am trying to use powershell to mail-enabled several hundred
R> AD contacts objects. I am testing on one contact object with the
R> following one-liner:
R>
R> get-contact -identity "domain.com/Users/Test Contact" | foreach {
R> enable-mailcontact -ExternalEmailAddress $_.WindowsEmailAddress }
R>
R> The WindowsEmailAddress attribute has a valid SMTP address but the
R> command fails with the following message:
R>
R> Enable-MailContact : Cannot bind parameter 'ExternalEmailAddress'.
R> Cannot convert "test.c...@domain.com" to
R> "Microsoft.Exchange.Data.ProxyAddress".
R>
R> There isn't much information on Microsoft.Exchange.Data.ProxyAddress
R> other than it is looking for a SMTP address which I believe I have
R> supplied it.
R>
R> Anyone here have any ideas on the error or another approach?
R>
What do you get for:
PS > Get-Contact 'Test Contact' | Disable-MailContact
Is it similar to this error:
PS > Disable-MailContact : "domain.com/Users/Test Contact" is not a mail
contact.
If so, does this work:
Get-Contact 'Test Contact' | foreach {
Enable-MailContact $_ -externalEmailAddress $_.windowsEmailAddress.toString()
}
---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar
R> Hi Shay - Unfortunately no. There are several Exchange attributes
R> that need to get populated besides the e-mail address. This seems
R> like it should be a very straightforward powershell command
R> sequence..
R>
R> "Shay Levy [MVP]" wrote:
R>