0 votes

Hello Supportteam.

I have implemented the Reconnect MAilbox Script from the Script Repository.
It is working fine except one detail of the mailbox restore.
I want that the reconnected mailbox will be created in the same DB as before.
We have 16 DB on our Exchange, and some for external employees.
Is this possible?

Regards

Massimo

by (450 points)

1 Answer

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

Hello Massimo,

Yes, it is possible. For this purpose, you need to use the first script from the following article in our repository to disconnect mailboxes: https://www.adaxes.com/script-repositor ... g-s113.htm. The mailbox database DN will be stored in the property specified by the $mbStorePathProperty variable.

When you reconnect a mailbox, use the second script from the same article in our repository. The script will restore the mailbox in the database whose DN is stored in the property specified by the $mbStorePathProperty variable.

0

Hello,

this isn't correct, in my case.
I am disconnecting the Mailbox with the first script, and it works fine.
When I reconnect the Mailbox with the second script, the Mailbox ist correctly connected, but on an other DB.
Before disconnecting the Mailbox was on EXT-DB04, after reconnecting it is on User-DB05.

Regards

Massimo

0

Hello Massimo,

Exchange does not immediately synchronize mailbox state which actually causes the issue. To check whether the mailbox state is synchronized:

  1. Disconnect a mailbox in Adaxes using the script from our repository.
  2. Copy the value of the property specified by the $mbStorePathProperty variable.
  3. Sign in to the computer where Exchange is installed and run PowerShell.
  4. Execute the following command:
    Get-MailboxStatistics -Database <database_store> | where {$_.DisconnectDate -ne $Null}
    Where <database_store> is the value you copied on step 2.

Usually, mailboxes are added to the disconnected list once a day. For information on how to synchronize mailbox state, have a look at the following article: https://technet.microsoft.com/en-us/lib ... .150).aspx.

0

Hello,

should I do this everytime when I disconnect a Mailbox?
It isn't possible to write an command, that with a special attribut the mailbox will be created in a certain DB?

Regards

Massimo

0

Hello Massimo,

should I do this everytime when I disconnect a Mailbox?

No, there is no need to check whether the mailbox state was synchronized or force the sync each time. You need to do it only for testing purposes because you are trying to run the scripts one after another.

It isn't possible to write an command, that with a special attribut the mailbox will be created in a certain DB?

If a mailbox state is successfully synchronized, the Reconnect Mailbox script will work fine. There is no need to change anything.

However, if you want to just create new mailboxes for users in the same DB they previously had rather than reconnecting the mailboxes, you will need to use a different script. The script should use the value of the property specified by the $mbStorePathProperty variable in the Disconnect Mailbox script for the new mailbox store.

0

Hello,

so I don't need to do it, after the nightsync of the Exchange.
But if I need it immediately, then I have to start a sync manually, right?

Regards

Massimo

0

Hello Massimo,

Yes, you are right.

0

Sorry but it does not work.
It does not reconnect the mailbox in the old database.
After waiting the sync in the night, same problem...
In Attribut is the correct database shown.
We have 2 Exchangeserver which are hosting the DBs, one for odd and one for even numbers.
How can I check, why the reconnect fails?

Thank you

0

Hello Massimo,

We have updated the Reconnect script for you. It will only reconnect mailboxes and not create new if a disconnected mailbox is not found. The script will through an error if a disconnected mailbox with the specified identity is not found.

$exchangeServer = "exchangeserver.domain.com" # TODO: Modify me
$mbGUIDProperty = "adm-CustomAttributeBinary1" # TODO: modify me
$mbStorePathProperty = "adm-CustomAttributeText1" # TODO: modify me

# Get mailbox GUID and Exchange mailbox store DN from Adaxes custom attributes
try
{
    $mailboxGuidByte = $Context.TargetObject.Get($mbGUIDProperty)
    $mailboxStoreDN = $Context.TargetObject.Get($mbStorePathProperty)
}
catch
{
    # No saved information about a disconnected mailbox
    return
}

try
{
    # Create a remote PowerShell session to the Exchange Server
    $session = New-PSSession -connectionURI "http://$exchangeServer/powershell" -ConfigurationName Microsoft.Exchange
    Import-PSSession -session $session -DisableNameChecking -AllowClobber

    # Reconnect the mailbox
    $mailboxGuid = [Guid]$mailboxGuidByte
    try
    {
        Connect-Mailbox -Identity $mailboxGuid -Database $mailboxStoreDN -User "%distinguishedName%" -ErrorAction Stop
    }
    catch
    {
        $Context.LogMessage("An error occurred when connecting mailbox. Error: " + $_.Exception.Message, "Error")
        return
    }
}
finally
{
    # Exit remove session, release resources
    if ($session) { Remove-PSSession -Session $session }
}

As per our check, it is a known issue in Exchange that even after synchronization the state of a disconnected mailbox is not updated. That is exactly what causes the issue, it is not related to Adaxes or the script used to reconnect mailboxes. To remedy the issue, you need to check Exchange settings.

Related questions

0 votes
1 answer

Hi, I would like to know whether it is possible to modify a shared mailbox after creation with a business rule. We create the shared mailbox on prem using a custom command ... 't how to identity the user object type as a shared mailbox. Thanks, Thomas Maurer

asked 18 hours ago by MaurerT (50 points)
0 votes
1 answer

After creating a user, I want to create a mailbox that is visible both on-premises and in Exchange Online (remote mailbox). The presence in on-premises Exchange is required ... migration is completed. The groups the user is being added to are license groups.

asked Oct 21 by Cas (200 points)
0 votes
0 answers

We currently convert user mailboxes to shared mailboxes during deprovisioning process but if the user mailbox was already a shared mailbox then the script throws an error ... user mailbox. Here is the actions of the current deprovision command: Thanks!

asked Oct 1 by Carlos (40 points)
0 votes
1 answer

So if we change the flow on the exisitng deprovision script to the above, is there a way to set a retention policy tag to the converted mailbox? Our standard retention is 90 days.

asked Sep 19 by EnbyAdmin (60 points)
0 votes
1 answer

Hi. How can we assign O365 licence to Room mailbox (exemple teams room device)? Activate / modify Office 365 property step is not available on that kind of object. Therefore, ... a custom command to set the licence and do other stuff on that kind of object.

asked Sep 19 by dper (20 points)
3,552 questions
3,242 answers
8,243 comments
547,828 users