dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


This command verifies that your non-dynamic disks are aligned according to physical constraints.

Returns $true or $false by default for one server. Returns Server name and IsBestPractice for more than one server.

Specify -Detailed for additional information which returns some additional optional “best practice” columns, which may show false even though you pass the alignment test. This is because your offset is not one of the “expected” values that Windows uses, but your disk is still physically aligned.

Please refer to your storage vendor best practices before following any advice.

Also, thanks goes out to Argenis Fernandez from Pure Storage for his help with this command.




To test the disk alignment of a single server named sqlserver2014a

Test-DbaDiskAlignment -ComputerName sqlserver2014a

To test the disk alignment of mulitiple servers

Test-DbaDiskAlignment -ComputerName sqlserver2014a, sqlserver2014b, sqlserver2014c

To see the details about the disk alignmenet calcualtions from multiple servers

Test-DbaDiskAlignment -ComputerName sqlserver2014a, sqlserver2014b, sqlserver2014c -Detailed


Disk Partition Alignment Best Practices for SQL Server – A great article and behind most of this code.

Getting Partition Offset information with Powershell – Thanks to Jonathan Kehayias!

Decree: Set your partition Offset and block Size – make SQL Server faster – Thanks to Jen McCown!

Disk Performance Hands On – Thanks to Kendal Van Dyke!

Get WMI Disk Information – Thanks to jbruns2010!


This command was created by Constantine Kokkinos. You can find Constantine on Twitter, constantinekokkinos.com and LinkedIn.


From PowerShell, execute Get-Help Test-DbaDiskAlignment -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-DbaDiskAlignment.ps1 on GitHub

Related commands