Michael Leonard
asked on
Need urgent assistance with powershell script - exchange
can someone help us with this script, here is the situation, we have on premise exchange 2010 and have migrated a few hundred mailboxes to 365, this has converted the on premise mailbox, into a "remote mailbox" object.
we need to add an additional proxy address to a few hundred of these. here is the script that works fine when run against Exchange on premise mailboxes, how can we modify this to run against the "remote mailbox" object that now exists:
we need to add an additional proxy address to a few hundred of these. here is the script that works fine when run against Exchange on premise mailboxes, how can we modify this to run against the "remote mailbox" object that now exists:
Import-Csv alias-add-var-gen1.csv | % {
Get-Mailbox $_.SMTP | Set-Mailbox -emailAddresses @($user.emailAddresses)+$_.newsmtp
}
ASKER
yes i have tried changing our script that way and using "get-remotemailbox" instead, but it generated errors.
here is the error:
here is the error:
Cannot process argument transformation on parameter 'EmailAddresses'. Cannot convert value "System.Collections.ArrayLis
t" to type "Microsoft.Exchange.Data.ProxyAddressCollection". Error: "MultiValuedProperty collections cannot contain nul
l values.
Parameter name: item"
+ CategoryInfo : InvalidData: (:) [Set-RemoteMailbox], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-RemoteMailbox
Cannot process argument transformation on parameter 'EmailAddresses'. Cannot convert value "System.Collections.ArrayLis
t" to type "Microsoft.Exchange.Data.ProxyAddressCollection". Error: "MultiValuedProperty collections cannot contain nul
l values.
Parameter name: item"
+ CategoryInfo : InvalidData: (:) [Set-RemoteMailbox], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-RemoteMailbox
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks that worked! appreciate it!
Nice!!
Import-Csv alias-add-var-gen1.csv | % {
Get-RemoteMailbox $_.SMTP | Set-RemoteMailbox -emailAddresses @($user.emailAddresses)+$_
}