Set MPIO Policy via PowerShell for Storage Spaces

Here is a small script to set the MPIO Policy via Powershell according to Microsofts Best Practices for Storage Spaces as seen here

It will set the Global MPIO policy to Least Block and then change the MPIO Policy for all SSD’s to Round Robin. Though, it’s possible that mpclaim.exe will use a different DiskID from what Powershell/Device Manager is using.
So the script has a built-in feature to adjust the DiskId if needed, though you have to verify and set the value manually before running the script! 


2 thoughts on “Set MPIO Policy via PowerShell for Storage Spaces”

  1. Tjena Marcus. Bra post. Hittade ett sätt att räkna ut MPIO disk ID dynamiskt.

    $ssds | %{
    # Get disk uniqueid
    Write-Output “Physical Disk Unique ID:”
    $UniqueID = $_.UniqueId

    $MPIODisk = (gwmi -Namespace root\wmi -Class mpio_disk_info).driveinfo | ?{$_.SerialNumber -eq $UniqueID}

    Write-Output “MPIO Disk:”
    $MPIODiskID = $MPIODisk.Name.Replace(“MPIO Disk”,””)
    $ArgumentList = “-l -d $MPIODisk 2”
    start-process “c:\windows\system32\mpclaim.exe” -ArgumentList $ArgumentList -Wait

Leave a Reply