Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Wed, 30 Apr 2008 14:02:03 -0700,    group: microsoft.public.exchange.tools        back       


Powershell question   
ForEach ($strPF in $arrPFs) {
$PF = Get-MailPublicFolder $strPF
$PF.EmailAddresses += $arrProxySMTPs[$i]
$PF | set-mailpublicfolder
$i++
}

value of $arrproxysmtps[$i] is simply an email address like asdf@asdf.com
if i test with a normal $var with the same value it works. like $var = 
asdf@asdf.com

$variable | get-member shows "system.string"
$arrproxysmtps[$i] | get-member shows "system.string"

Exception setting "EmailAddresses": "Cannot convert value "System.Object[]" 
to type "Microsoft.Exchange.Data.ProxyAddressCollection". Error: "Conversion 
from System.Management.Automation.PSObject to 
Microsoft.Exchange.Data.ProxyAddress has not been implemented.""
date: Wed, 30 Apr 2008 14:02:03 -0700   author:   mipbar

RE: Powershell question   
Hi
I have two comments, may be one of it answers your question

a)
in your example the address space of the address you want to add is missing 
you should add: "smtp:asdf@asdf.com"


b)
I did the same and here is a part of my example and it works
 [Array]$newProxies = [Array]$newProxies + $proxy.ProxyAddressString  
 $mailbox.EMailAddresses = $newProxies
 $mailbox | set-mailbox


"mipbar" wrote:

> ForEach ($strPF in $arrPFs) {
> $PF = Get-MailPublicFolder $strPF
> $PF.EmailAddresses += $arrProxySMTPs[$i]
> $PF | set-mailpublicfolder
> $i++
> }
> 
> value of $arrproxysmtps[$i] is simply an email address like asdf@asdf.com
> if i test with a normal $var with the same value it works. like $var = 
> asdf@asdf.com
> 
> $variable | get-member shows "system.string"
> $arrproxysmtps[$i] | get-member shows "system.string"
> 
> Exception setting "EmailAddresses": "Cannot convert value "System.Object[]" 
> to type "Microsoft.Exchange.Data.ProxyAddressCollection". Error: "Conversion 
> from System.Management.Automation.PSObject to 
> Microsoft.Exchange.Data.ProxyAddress has not been implemented.""
>
date: Mon, 5 May 2008 08:48:00 -0700   author:   Henry

RE: Powershell question   
$PF.EmailAddresses += $arrProxySMTPs[$i]

to

$PF.EmailAddresse += [string]$arrProxySMTPs[$i] 

fixed it.  For some reason the array value wasn't being read as a string.  A 
get-member showed system.string but still that fixed it.  <shrug>

"Henry" wrote:

> Hi
> I have two comments, may be one of it answers your question
> 
> a)
> in your example the address space of the address you want to add is missing 
> you should add: "smtp:asdf@asdf.com"
> 
> 
> b)
> I did the same and here is a part of my example and it works
>  [Array]$newProxies = [Array]$newProxies + $proxy.ProxyAddressString  
>  $mailbox.EMailAddresses = $newProxies
>  $mailbox | set-mailbox
> 
> 
> "mipbar" wrote:
> 
> > ForEach ($strPF in $arrPFs) {
> > $PF = Get-MailPublicFolder $strPF
> > $PF.EmailAddresses += $arrProxySMTPs[$i]
> > $PF | set-mailpublicfolder
> > $i++
> > }
> > 
> > value of $arrproxysmtps[$i] is simply an email address like asdf@asdf.com
> > if i test with a normal $var with the same value it works. like $var = 
> > asdf@asdf.com
> > 
> > $variable | get-member shows "system.string"
> > $arrproxysmtps[$i] | get-member shows "system.string"
> > 
> > Exception setting "EmailAddresses": "Cannot convert value "System.Object[]" 
> > to type "Microsoft.Exchange.Data.ProxyAddressCollection". Error: "Conversion 
> > from System.Management.Automation.PSObject to 
> > Microsoft.Exchange.Data.ProxyAddress has not been implemented.""
> >
date: Mon, 5 May 2008 16:31:01 -0700   author:   mipbar

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us