########## BEGIN SCRIPT HEADER ########## # WINDOWS 2008 R1 x64, 2008 R2, 2012 R2 - MPIO HOTFIX INSTALLER # Author: Anthony Marino # Version: V1.0.1 # Date: 8/6/2015 ########## END SCRIPT HEADER ########## IF ((((Get-WmiObject Win32_OperatingSystem).Version) -like "6.0.*") -and (Test-Path 'C:\Program Files (x86)' -ErrorAction SilentlyContinue)) { # Server 2008 R1 x64 Write-Host "Server 2008 R1 x64 detected." # Find out if the MPIO hotfix KB2754704 is installed IF (get-HotFix | where {$_.hotfixid -eq "KB2754704"}) { # HotFix is installed. Write-Host "KB2754704 is already installed." } ELSE { Write-Host "Installing KB2754704." # Download and install the HotFix $Source = "http://toolkit.datapipe.net/BesTasks/anthony/ServerSetupUtility/Installers/MPIOHotfixes/Windows6.0-KB2754704-x64.msu" $Destination = "C:\Windows\Temp\Windows6.0-KB2754704-x64.msu" $client = new-object System.Net.WebClient $client.DownloadFile($Source, $Destination) Start-Process -FilePath wusa.exe -ArgumentList "C:\Windows\Temp\Windows6.0-KB2754704-x64.msu /quiet /norestart" -Wait # Cleanup Remove-Item C:\Windows\Temp\Windows6.0-KB2754704-x64.msu -Force } } IF (((Get-WmiObject Win32_OperatingSystem).Version) -like "6.1.*") { # Server 2008 R2 Write-Host "Server 2008 R2 detected." # Add registry keys to adjust MPIO IF (Get-Service "ClusSvc" -ErrorAction SilentlyContinue) { # Cluster service detected # Add KB2718576 registry changes (clusters only) REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v DiskPathCheckEnabled /t REG_DWORD /d 1 /f REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v DiskPathCheckInterval /t REG_DWORD /d 0 /f } REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v UseCustomPathRecoveryInterval /t REG_DWORD /d 1 /f REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v PathRecoveryInterval /t REG_DWORD /d 15 /f REG ADD "HKLM\System\CurrentControlSet\Services\Disk" /v TimeOutValue /t REG_DWORD /d 30 /f REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v PDORemovePeriod /t REG_DWORD /d 25 /f REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v RetryCount /t REG_DWORD /d 3 /f REG ADD "HKLM\System\CurrentControlSet\Services\mpio\Parameters" /v RetryInterval /t REG_DWORD /d 1 /f # Find out if the MPIO hotfix KB2754704 is installed IF (get-HotFix | where {$_.hotfixid -eq "KB2754704"}) { # HotFix is installed. Write-Host "KB2754704 is already installed." } ELSE { Write-Host "Installing KB2754704." # Download and install the HotFix $Source = "http://toolkit.datapipe.net/BesTasks/anthony/ServerSetupUtility/Installers/MPIOHotfixes/Windows6.1-KB2754704-x64.msu" $Destination = "C:\Windows\Temp\Windows6.1-KB2754704-x64.msu" $client = new-object System.Net.WebClient $client.DownloadFile($Source, $Destination) Start-Process -FilePath wusa.exe -ArgumentList "C:\Windows\Temp\Windows6.1-KB2754704-x64.msu /quiet /norestart" -Wait # Cleanup Remove-Item C:\Windows\Temp\Windows6.1-KB2754704-x64.msu -Force } # Find out if the MPIO hotfix KB2821052 is installed IF (get-HotFix | where {$_.hotfixid -eq "KB2821052"}) { # HotFix is installed. Write-Host "KB2821052 is already installed." } ELSE { Write-Host "Installing KB2821052." # Download and install the HotFix $Source = "http://toolkit.datapipe.net/BesTasks/anthony/ServerSetupUtility/Installers/MPIOHotfixes/Windows6.1-KB2821052-x64.msu" $Destination = "C:\Windows\Temp\Windows6.1-KB2821052-x64.msu" $client = new-object System.Net.WebClient $client.DownloadFile($Source, $Destination) Start-Process -FilePath wusa.exe -ArgumentList "C:\Windows\Temp\Windows6.1-KB2821052-x64.msu /quiet /norestart" -Wait # Cleanup Remove-Item C:\Windows\Temp\Windows6.1-KB2821052-x64.msu -Force } } IF (((Get-WmiObject Win32_OperatingSystem).Version) -like "6.2.*") { # Server 2012 R1 Write-Host "Server 2012 R1 detected." # Find out if the MPIO hotfix KB2821052 is installed IF (get-HotFix | where {$_.hotfixid -eq "KB2821052"}) { # KB2821052 is already installed. Write-Host "KB2821052 is already installed." } ELSE { Write-Host "Installing KB2821052." # Download and install the HotFix Invoke-WebRequest http://toolkit.datapipe.net/BesTasks/anthony/ServerSetupUtility/Installers/MPIOHotfixes/Windows8-RT-KB2821052-x64.msu -OutFile C:\Windows\Temp\Windows8-RT-KB2821052-x64.msu Start-Process -FilePath wusa.exe -ArgumentList "C:\Windows\Temp\Windows8-RT-KB2821052-x64.msu /quiet /norestart" -Wait # Cleanup Remove-Item C:\Windows\Temp\Windows8-RT-KB2821052-x64.msu -Force } }