PowerShell Cmdlets
Published 14 February 2023
This page will give an overview of how to access information about the PowerShell Cmdlets provided by the SQL Monitor PowerShell Module.
Once you have imported the PowerShell Module, you can view a list of the available Cmdlets using the following command:
Get-Command -Module RedgateSQM | Select Name
This will give you an output like this:
Name ---- Add-SqlMonitorAccessRights Add-SqlMonitorAnnotation Add-SqlMonitorMonitoredObject Connect-SqlMonitor Get-SqlMonitorADPrincipal Get-SqlMonitorAlertSettings Get-SqlMonitorAlertSuppressionWindow Get-SqlMonitorAmazonRdsSqlServer Get-SqlMonitorAnnotation Get-SqlMonitorAvailabilityGroup Get-SqlMonitorAzureManagedInstance Get-SqlMonitorAzureSqlServer Get-SqlMonitorBaseMonitor Get-SqlMonitorCluster Get-SqlMonitorDatabase Get-SqlMonitorDisk Get-SqlMonitorElasticPool Get-SqlMonitorGroup Get-SqlMonitorInstance Get-SqlMonitorJob Get-SqlMonitorMachine Get-SqlMonitorMainGroups Get-SqlMonitorMonitoredObjectStatus Get-SqlMonitorSubGroups New-SqlMonitorADPrincipal New-SqlMonitorAlertSpecificSettings New-SqlMonitorAlertSuppressionWindow New-SqlMonitorGroup Remove-SqlMonitorAccessRights Remove-SqlMonitorADPrincipal Remove-SqlMonitorAlertSuppressionWindow Remove-SqlMonitorAnnotation Remove-SqlMonitorGroup Remove-SqlMonitorMonitoredObject Test-SqlMonitorGroupAccess Test-SqlMonitorMonitoredObjectAccess Update-SqlMonitorADPrincipal Update-SqlMonitorAlertNotificationSettings Update-SqlMonitorAlertSettingsComments Update-SqlMonitorAlertSettingsStatus Update-SqlMonitorAlertSpecificSettings Update-SqlMonitorAlertSuppressionWindow Update-SqlMonitorAnnotation Update-SqlMonitorMonitoredObjectSuspendedStatus
For details on a specific Cmdlet, you can use the built-in PowerShell function Get-Help
. For instance, if you wanted to find out the specifics of the Update-SqlMonitorAlertSpecificSettings
Cmdlet, you would use:
Get-Help Update-SqlMonitorAlertSpecificSettings
The output would look something like this:
Get-Help Update-SqlMonitorAlertSpecificSettings NAME Update-SqlMonitorAlertSpecificSettings SYNOPSIS Updates the alert settings for a specific alert type and target monitored object. SYNTAX Update-SqlMonitorAlertSpecificSettings [-MonitoredObject] <MonitoredObject> [-AlertType] <Int32> [-Settings] <SpecificAlertSettings> [<CommonParameters>] DESCRIPTION Updates the alert settings for a specific alert type and monitored object. The alert settings object will depend on the alert type. RELATED LINKS REMARKS To see the examples, type: "Get-Help Update-SqlMonitorAlertSpecificSettings -Examples" For more information, type: "Get-Help Update-SqlMonitorAlertSpecificSettings -Detailed" For technical information, type: "Get-Help Update-SqlMonitorAlertSpecificSettings -Full"
Many of the Cmdlets take in parameters of types defined by the SQL Monitor PowerShell Module. For clarification on these types, view the Custom Types page. You can also consult the example scripts available in SQL Monitor itself for further guidance.