0 votes

I'm trying to come up with an additional Exchange 2010 task (part of deprovisioning) that will preserve all of the existing email addresses of a given user, but simply prefix them with the word "disabled." The reason is so that we can stop email flow at the moment of deprovisioning, but in case we need to repurpose any of the multiple proxy addresses, we'll know exactly what they were.

For example, Bob User has the following proxy addresses:
bob.user@company1.com
buser@company5.com
b.user@company6.com

So, by convention, those addresses get changed to the following:
disabled.bob.user@company1.com
disabled.buser@company5.com
disabled.b.user@company6.com

This would save us a lot of time.

by (470 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

Hello,

This can be done with PowerShell scripts. For example, you can extend the Custom Command that you use for deprovisioning with the Run a program or PowerShell script action containing a script that changes the e-mail addresses. To add such an action:

  1. Launch Adaxes Administration Console.

  2. In the Console Tree, navigate to and select the Custom Command that you use for deprovisioning.

  3. Select the set of actions and conditions that you would like to add the action to.

  4. Click the Add Action button.

  5. Select he Run a program or PowerShell script action and paste the following script in the Script field.

     $mailboxParams = $Context.TargetObject.GetMailParameters()
    
     $mailboxParams.EmailAddressPolicyEnabled = $False
     $emailAddresses = $mailboxParams.EmailAddresses
     for ($i = 0; $i -lt $emailAddresses.Count; $i++)
     {
         $emailAddress = $emailAddresses.GetAddress($i,[ref]"ADS_PROPERTY_NONE")
         $emailAddress.Address = "disabled." + $emailAddress.Address
     }
    
     $mailboxParams.EmailAddresses = $emailAddresses
     $Context.TargetObject.SetMailParameters($mailboxParams, "ADM_SET_EXCHANGE_PARAMS_FLAGS_NONE")
0

Excellent! The script works as expected.

Thank you very much!

Related questions

0 votes
1 answer

I have been testing different methods to do this with a powershell script, and it doesn't seem like the most reliable method with my limited PowerShell scripting ... ; Delete Mailbox task as a custom task for automated user deprovisioning. Thanks! Chris

asked May 16, 2017 by Bowman4864 (270 points)
0 votes
1 answer

I am attempting to update a business rule using PowerShell to include additional approves. This is what I have so far $account = "username" # Connect to the Adaxes ... in the second code block. Any assistance would be appreciated. (love the powershell!)

asked Oct 15, 2014 by david.towle-hilt (70 points)
0 votes
1 answer

We have a need to only allow users to groups based on employee type attribute. We have created a scheduled task today that scans AD every day at 9:00am and adds the ... like to stop the user from even be added outside of this task altogether. Any ideas?

asked Feb 19, 2019 by willy-wally (3.2k points)
0 votes
1 answer

Hi All, I'm trying to have a scheduled task email the helpdesk a list of machines from AD that have no description. I created a script and it runs the way I want it ... into just one email. Id like to run that in scheduled task if possible. Many thanks, Will

asked Nov 20, 2017 by will17 (350 points)
0 votes
1 answer

Hi Because we are in the process of integrating a new company, we need to create their new users in their old domain and then migrate across using ADMT. Once migrated, ... running. Would the business rules be classed as part of the scheduled task? Thanks Matt

asked Sep 11, 2017 by chappers77 (2.0k points)
3,374 questions
3,073 answers
7,817 comments
545,387 users