I have a termination script that I run when we are terminating employees. Part of this termination process is to create email forwarding distribution groups where requested. These forwarding groups use the terminated employee’s original email address as the primary smtp.
I have 3 questions about this.
After the mailbox is archived it’s disabled. This is done in a batch and only those mailboxes where the archive completed successfully will be disabled. Occasionally the mailbox does not get disabled but there are no error messages regarding that part of the process. Is there something I can add at this point to tell me that the mailbox disable was not successful? If the mailbox does not get disabled and an email forwarding group is being created it fails because the smtp address is already in use.
I have a sleep built in between the disabling of the mailboxes and the creation of any requested email forwarding groups. Occasionally the email account will be disabled but the group can’t be created because it is still seeing the primary smtp as in use. It is random as to which one might not work. There isn’t any sort of order such as the first one in the list or the last one.
I found out today that I need to be adding an X500 proxy email address to the email forwarding groups as well as the primary smtp address. I know how to do each one individually but am not sure how I can put the 2 together to create them and add them at the same time during the creation of the group. Any help would be greatly appreciated.