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


Get-DbaMaxMemory

This command retrieves the SQL Server ‘Max Server Memory’ configuration setting as well as the total physical installed on the server.

Screenshots

Examples

To get memory settings for all servers within the SQL Server Central Management Server “sqlcluster”.

Get-DbaMaxMemory -SqlServer sqlcluster,sqlserver2012

To find all servers in Server Central Management Server that have ‘Max Server Memory’ set to higher than the total memory of the server (think 2147483647)

Get-DbaMaxMemory -SqlServer sqlcluster | Where-Object { $_.SqlMaxMB -gt $_.TotalMB }

Get-Help

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

Source Code

Want to see the source code? View Get-DbaMaxMemory.ps1 on GitHub
 

Related commands