dbatools is a free PowerShell module with over 200 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


Get-DbaMemoryUsage

Get amount of memory in use by all SQL Server components and instances.

Retrieves the amount of memory per performance counter. Default output includes columns Server, counter instance, counter, number of pages, memory in KB, memory in MB

SSAS and SSIS are included.

SSRS does not have memory counters, only memory shrinks and memory pressure state.

This function requires local admin role on the targeted computers.

Screenshots

Examples

To return a custom object displaying Server, counter instance, counter, number of pages, memory in KB, memory in MB

Get-DbaMemoryUsage -ComputerName ServerA

To return a custom object with Server, counter instance, counter, number of pages, memory in KB, memory in MB

Get-DbaMemoryUsage -ComputerName ServerA\sql987 -Simple

To return a gridview displaying Server, counter instance, counter, number of pages, memory in KB, memory in MB

Get-DbaMemoryUsage -ComputerName ServerA\sql987 | Out-Gridview

Author

This command was created by Klaas Vandenberghe. You can find Klaas on Twitter and his blog.

Get-Help

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

Source Code

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

Related commands