Forum Discussion

OldEmployee's avatar
8 years ago
Solved

Restart Archive Tasks - Script

I know this is not primarily a scripting community.

But I was wondering if anyone could help me with a script that would restart the archive tasks on all the EV servers?

I tried looking into the EV shell, but there are no cmdlets for archive tasks.

8 Replies

    • OldEmployee's avatar
      OldEmployee
      Level 5

      Thanks for this information.

      I tried testing it with a single task, but it seems to be looking for a service:

      .\EVService.exe stop server1 "Index Administration Task"

      Response

      Stopping Index Administration Task on server1....
      Error: The specified service does not exist as an installed service.

      Does it needs to be executed from the EV Shell? Or do I need to use the task ID?

      • G_Fry's avatar
        G_Fry
        Level 4

        The EV Service names are as follows:

        EnterpriseVaultAdminService
        "Enterprise Vault Directory Service"
        EnterpriseVaultIndexingService
        EnterpriseVaultShoppingService
        EnterpriseVaultStorageService
        EnterpriseVaultTaskControllerService

        its only the directory service that has spaces in it.

         

  • We usually see multiple entries for the same journal mailbox in the J3 queues on journal archiving servers and hence we need to clear the J3 queues and restart the journal tasks again. We run the following powershell commands remotely on each of our journal archiving servers atleast once a day to stop the tasks, clear MSMQ entries, clear the MAPI profiles (Outlook 2013) and start the tasks.

    For mailbox archiving servers, if required, we clear the A5 queues as well incase there are any stale entries from the previous scheduled run.

    Stop-Service "EnterpriseVaultTaskControllerService"
    Get-MsmqQueue | where {$_.queuename -like "*private$* j3*"} | Clear-MsmqQueue # for journal archiving servers
    Get-MsmqQueue | where {$_.queuename -like "*private$* a5*"} | Clear-MsmqQueue # for mailbox archiving servers
    Get-ChildItem -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Profiles" | Where-Object {$_.PSChildName -like "EV_*"} | Remove-Item -Force -Recurse
    Start-Service "EnterpriseVaultTaskControllerService"