< Back

Test-DbaDiskAllocation

Mon Jan 13, 2020 6:08 pm

NAME Test-DbaDiskAllocation



SYNOPSIS

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





SYNTAX

Test-DbaDiskAllocation [-ComputerName] <System.Object[]> [-NoSqlCheck <Switch>] [[-SqlCredential] <Pscredential>]

[[-Credential] <Pscredential>] [-EnableException <Switch>] [<CommonParameters>]





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/lib ... .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."





PARAMETERS

-ComputerName [<System.Object[]>]

The server(s) to check disk configuration on.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Credential [<Pscredential>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-NoSqlCheck [<Switch>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlCredential [<Pscredential>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Collections.ArrayList



System.Boolean





NOTES





Tags: CIM, Storage

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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.



RELATED LINKS

https://dbatools.io/Test-DbaDiskAllocation