-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareMasterFile.ps1
More file actions
39 lines (37 loc) · 914 Bytes
/
Copy pathCompareMasterFile.ps1
File metadata and controls
39 lines (37 loc) · 914 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
31
32
33
34
35
36
37
38
39
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]
$OldFile,
[Parameter(Mandatory=$true)]
[string]
$NewFile
)
BEGIN{}
PROCESS{
$Mailbox_Types = @(
"User Mailboxes",
"Shared Mailboxes",
"Room Mailboxes",
"Equipment Mailboxes"
)
$Old = @()
$New = @()
foreach ($T in $Mailbox_Types){
Try{
$temp_old = (Import-Excel $OldFile -WorksheetName $T -erroraction Stop -warningAction silentlycontinue).'Source Mailbox'
}
catch{
$temp_old = @()
}
Try{
$temp_new = (Import-Excel $NewFile -WorksheetName $T -erroraction Stop -warningAction silentlycontinue).'Source Mailbox'
}
catch{
$temp_new = @()
}
$Old += $temp_old
$New += $temp_new
}
Compare-Object -ReferenceObject $Old -DifferenceObject $New
}