Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to set the StorPort BusyRetryCount registry value using PowerShell


View products that this article applies to.

Summary

This script modifies the BusyRetryCount registry value located at HKLM\System\CurrentControlSet\Enum\SCSI\<device>\<instance>\Device Parameters\StorPort

For more information about this value, please see the following article:
An updated StorPort storage driver is available for Windows Server 2003
http://support.microsoft.com/kb/932755

For more information about how to write scripts for Windows PowerShell, visit the following Microsoft website:
General information about how to write scripts for Windows PowerShell

Registry information

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  How to back up and restore the registry in Windows


The vendor string variable is used to restrict the value change to a subset of disks matching a specific vendor's identifier. Check the registry for the Disk&Ven_ string to verify what value should be used.

$BusyRetry = 0
$vendor = Read-Host "Enter Vendor String"
$devIDs = Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Enum\SCSI\Disk*Ven_$vendor*\*\Device Parameters\"

foreach ($id in $devIDs)
{
$error.Clear()
$regpath = $id.PSPath + "\StorPort\"
Set-ItemProperty -path $regpath -Name BusyRetryCount -Value $BusyRetry -ErrorAction SilentlyContinue

if ($error) # didn't find the path, create it and try again
{
New-Item -Path $id.PSPath -Name StorPort
Set-ItemProperty -path $regpath -Name BusyRetryCount -Value $BusyRetry -ErrorAction SilentlyContinue
$error.Clear()
}

Get-ItemProperty -Path $regpath -Name BusyRetryCount -ErrorAction SilentlyContinue | Select BusyRetryCount | fl | Out-String -Stream
}


↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2848785
Revision : 1
Created on : 1/7/2017
Published on : 5/13/2013
Exists online : False
Views : 507