powershell script for selecting the external address of a mailuser account
Ive got an issue with a domino migration that Ive described here. It would be nice to fix this problem at the source, but a workaround might also be sufficient. Mail-enabled users (mailusers) are being created by the transporter suite, and the external email address is being set to whatever WAS the primary smtp address on their former contact. So for example I have a user John Smith that has proxy addresses of jsmith@exchange.local, jsmith@domino.local and jsmith@company.com. Currently all users are being setup with @company.com as their external address. For the purposes of my coexistence, this will not work. I need the external address for all migrated users to be @domino.local. This is easy enough to fix in the GUI by selecting the @domino.local address for a given user and pressing mark as external. But how can I script this for an entire OU? I think I would need the script to first identify everyones @domino address, which of course would not be a static variable, and then set it to be the external one. It would be super swell, if someone would write this one up for me? Im not quite at that level with my powershell skills yet!! Mike Crowley: MCT, MCSE, MCTS, MCITP: Enterprise Administrator / Messaging Administrator
April 7th, 2009 6:12pm

I am not a master in powershell yet, but I managed to write one liner for you... Suggest you to test it in test environment first. $mbx = Get-Recipient -Filter "EmailAddresses -like '*@domain.local' -and recipienttype -eq 'mailuser'"; foreach ($a in $mbx) { foreach ($s in $a.EmailAddresses) {if ($s -like "*domain.local"){$t=[string]$a; $b=[string]$s; $b = $b.substring(5, $b.length-5);Set-MailUser -identity $t -ExternalEmailAddress $b}}} You can add -OrganizationalUnit switch in Get-Recipient cmdlet to set OU... Amit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
April 7th, 2009 7:10pm

Amit, this is awesome thanks! (and it works) Mike Crowley: MCT, MCSE, MCTS, MCITP: Enterprise Administrator / Messaging Administrator
April 8th, 2009 6:33pm

You are welcome buddy... :)Amit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2009 6:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics