-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMBAM_Update.ps1
80 lines (65 loc) · 2.43 KB
/
MBAM_Update.ps1
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#Set Current Directory
$ScriptPath = $MyInvocation.MyCommand.Path
$CurrentDir = Split-Path $ScriptPath
#Set Variables
$MDOPUpdateRequired = $False
$MDOPMSI = Join-Path $CurrentDir "MbamClientSetup-2.5.1100.0.msi"
$MDOPMSP = Join-Path $CurrentDir "MBAM2.5_Client_x64_KB4586232.msp"
$MDOPVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AEC5BCA3-A2C5-46D7-9873-7698E6D3CAA4}" -ErrorAction SilentlyContinue).DisplayVersion
If ($MDOPVersion) {
Switch ($MDOPVersion) {
"2.5.1100.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 Initial Package"
$MDOPUpdateRequired = $True
}
"2.5.1126.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 December 2016 Package"
$MDOPUpdateRequired = $True
}
"2.5.1133.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 March 2017 Package"
$MDOPUpdateRequired = $True
}
"2.5.1134.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 June 2017 Package"
$MDOPUpdateRequired = $True
}
"2.5.1143.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 July 2018 Package"
$MDOPUpdateRequired = $True
}
"2.5.1147.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 March 2019 Package"
$MDOPUpdateRequired = $True
}
"2.5.1152.0" {
Write-Output "MDOP is installed, the version is $MDOPVersion, 2.5SP1 October 2020 Package"
$MDOPUpdateRequired = $False
}
Default {
Write-Warning "MDOP Version could not be read"
Exit 1
}
}
}
else {
Write-Output "MDOP Doesnt Exist. Installing MDOP 2.5SP1 Base 2.5.1100.0...."
#Install MDOP 2.5SP1 Base 2.5.1100.0
$Args = @(
"/i"
"""$MDOPMSI"""
"/qn"
)
Start-Process msiexec -ArgumentList $Args -Wait -ErrorAction Stop | Out-Null
$MDOPUpdateRequired = $True
}
If ($MDOPUpdateRequired -eq $True) {
Write-Output "Installing MDOP 2.5SP1 October 2020 Package 2.5.1152.0...."
#Install MDOP 2.5SP1 October 2020 Patch
$Args = @(
"/p"
"""$MDOPMSP"""
"/qn"
)
Start-Process msiexec -ArgumentList $Args -Wait -ErrorAction Stop | Out-Null
}