SOLVED

Script to add multiple proxy addresses to Mailbox

Deleted
Not applicable

Hello Folks

 

any body has script handy? which would add multiple proxy addresses to Remote mailbox?

 

I looked over net but couldnot get relevant one.

 

Kindly please advice.

2 Replies
best response
Solution
If you work with DirSync and Exchange online, here's what you can do:

1. Create a CSV containing two columns- SamAccountName and ProxyAddresses (seperated in commas, in the format "smtp:address@domain")

2. On PowerShell import the active directory cmdlet by using "import-module active*"

3. Import CSV to a variable
$CSV=import-csv csvpath.csv

4. Following block will loop through users and addresses to add them

Foreach($User in $CSV)
{
Foreach($Address in $User.ProxyAddresses){Set-AdUser $User.SamAccountName -Add @{ProxyAddresses=$Address}}
}


5. Run a sync cycle to replicate into Office 365.

According to your other thread here you work with standalone Exchange online. If that's the case you can change the SamAccountName with mailbox alias and instead of "Set-AdUser" use "Set-Mailbox" on Exchange online shell.

Hope this helps. Feel free to let me know if you require any further assistance.

Maor Bracha

Thanks Buddy.

 

Let me try and come back to you.

1 best response

Accepted Solutions
best response
Solution
If you work with DirSync and Exchange online, here's what you can do:

1. Create a CSV containing two columns- SamAccountName and ProxyAddresses (seperated in commas, in the format "smtp:address@domain")

2. On PowerShell import the active directory cmdlet by using "import-module active*"

3. Import CSV to a variable
$CSV=import-csv csvpath.csv

4. Following block will loop through users and addresses to add them

Foreach($User in $CSV)
{
Foreach($Address in $User.ProxyAddresses){Set-AdUser $User.SamAccountName -Add @{ProxyAddresses=$Address}}
}


5. Run a sync cycle to replicate into Office 365.

According to your other thread here you work with standalone Exchange online. If that's the case you can change the SamAccountName with mailbox alias and instead of "Set-AdUser" use "Set-Mailbox" on Exchange online shell.

Hope this helps. Feel free to let me know if you require any further assistance.

Maor Bracha

View solution in original post