commands

^

Test-DbaDiskAllocation

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Test-DbaDiskAllocation on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaDiskAllocation.

Synopsis

Checks all disks on a computer to see if they are formatted with allocation units of 64KB.

Description

Checks all disks on a computer for disk allocation units that match best practice recommendations. If one server is checked, only $true or $false is returned. If multiple servers are checked, each server's name and an IsBestPractice field are returned.

References: https://technet.microsoft.com/en-us/library/dd758814(v=sql.100).aspx - "The performance question here is usually not one of correlation per the formula, but whether the cluster size has been explicitly defined at 64 KB, which is a best practice for SQL Server."

Syntax

Test-DbaDiskAllocation
    [-ComputerName] <Object[]>
    [-NoSqlCheck]
    [[-SqlCredential] <PSCredential>]
    [[-Credential] <PSCredential>]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Test-DbaDiskAllocation -ComputerName sqlserver2014a

Scans all disks on server sqlserver2014a for best practice allocation unit size.

Example: 2
PS C:\> Test-DbaDiskAllocation -ComputerName sqlserver2014 | Select-Output *

Scans all disks on server sqlserver2014a for allocation unit size and returns detailed results for each.

Example: 3
PS C:\> Test-DbaDiskAllocation -ComputerName sqlserver2014a -NoSqlCheck

Scans all disks not hosting SQL Server data or log files on server sqlserver2014a for best practice allocation unit size.

Required Parameters

-ComputerName

The server(s) to check disk configuration on.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-NoSqlCheck

If this switch is enabled, the disk(s) will not be checked for SQL Server data or log files.

Alias
Required False
Pipeline false
Default Value False
-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential). Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported. For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Credential

Specifies an alternate Windows account to use when enumerating drives on the server. May require Administrator privileges. To use: $cred = Get-Credential, then pass $cred object to the -Credential parameter.

Alias
Required False
Pipeline false
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False
-WhatIf

If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.

Alias wi
Required False
Pipeline false
Default Value
-Confirm

If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.

Alias cf
Required False
Pipeline false
Default Value