-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathma-reindex-tool-loop.ps1
More file actions
30 lines (28 loc) · 929 Bytes
/
ma-reindex-tool-loop.ps1
File metadata and controls
30 lines (28 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
<#
.SYNOPSIS
Script to loop the reindex tool on all stores in Archiver
.DESCRIPTION
This script will obtain a list of stores from the registry and
the reindex tool through this array
.NOTES
Email: helpdesk@exclaimer.com
Date: 12th August 2019
.PRODUCTS
Mail Archiver 4.0
.REQUIREMENTS
- Latest Mail Archiver install
- Reindex tool
.HISTORY
- Indexes mail when run for all stores. Only runs resync
- Adds date to log file it creates
#>
$path = 'HKLM:\SOFTWARE\Exclaimer Ltd\Mail Archiver 1.0\Configuration'
$stores = Get-ChildItem $path | Get-ItemProperty | Select-Object -ExpandProperty PSChildName
ForEach ($store in $stores) {
$date = Get-Date -Format "dd.MM.yy"
$logs = "C:\ProgramData\Exclaimer Ltd\reindex\logs.$store.$date.txt"
C:\ProgramData\"Exclaimer Ltd"\reindex\reindex.exe $store > $logs
write-output "This store has been completed $store"
#rm $logs
}