powershelldba.de
REF: PSDB-CMD-2026 SCOPE: sqmSQLTool core STATUS: 132 COMMANDS DOCUMENTED
Command reference

Every sqmSQLTool command, in one place.

132 PowerShell commands across 17 categories — each with parameters, usage notes, and runnable examples.

AlwaysOn 19

CommandDescription
Add-sqmDatabaseToAGAdds one or more databases to an Always On availability group (AutoSeed).
Compare-sqmAlwaysOnLoginsVergleicht die Logins aller Replicas einer AlwaysOn Availability Group.
Complete-sqmListenerMigrationCompletes listener migration after cluster team recreates the listener resource.
Export-sqmAlwaysOnConfigurationExports the complete AlwaysOn AG configuration for one or more SQL Server instances.
Get-sqmAlwaysOnFailoverHistoryErmittelt AlwaysOn-Failover-Ereignisse aus dem Windows Event Log.
Get-sqmAlwaysOnHealthReportCreates a detailed health report for all Always On availability groups on an instance.
Invoke-sqmAlwaysOnSetupEnd-to-end CLI AlwaysOn setup: reads the WSFC, creates the Availability Group and synchronises logins.
Invoke-sqmFailoverPerforms a controlled AlwaysOn AG failover with pre- and post-checks.
Invoke-sqmServiceBrokerAlwaysOnEnables Service Broker on all nodes of an AlwaysOn Availability Group with automatic failover orchestration.
Invoke-sqmSqlAlwaysOnAutoseedingEnables Automatic Seeding on all replicas of an Always On Availability Group.
Move-sqmAlwaysOnListenerMigrates an AG Listener from one Availability Group to another.
New-sqmAlwaysOnRepairJobCreates a SQL Server Agent job that runs Repair-Job.ps1 (AutoRepair).
New-sqmAutoLoginSyncJobCreates a SQL Agent job that runs Sync-Job.ps1 (AutoSync).
New-sqmAvailabilityGroupCreates an AlwaysOn Availability Group on an existing Windows Server Failover Cluster (WSFC).
Prepare-sqmListenerForMigrationPrepares an AG listener for cluster-level migration without downtime.
Remove-sqmDatabaseFromAGRemoves one or more databases from their Always On Availability Group.
Repair-sqmAlwaysOnDatabasesChecks all AlwaysOn databases for problems and repairs them (Remove -> Cleanup -> Add).
Sync-sqmAgNodeSynchronizes SQL Server objects from the primary replica to all secondary replicas of an Availability Group.
Sync-sqmLoginsToAlwaysOnSynchronizes logins from the primary replica to all secondary replicas in an AlwaysOn Availability Group.

Distributed AG 4

CommandDescription
Add-sqmDatabaseToDistributedAgAdds a database to a Distributed AlwaysOn Availability Group.
Get-sqmDistributedAgHealthCreates a detailed health report for Distributed AlwaysOn Availability Groups.
Invoke-sqmDistributedFailoverInitiates failover of a Distributed AlwaysOn AG.
New-sqmDistributedAvailabilityGroupCreates a new Distributed AlwaysOn Availability Group.

Service Broker 2

CommandDescription
Enable-sqmServiceBrokerEnables Service Broker on a specified database and creates SSB endpoint.
Get-sqmServiceBrokerHealthCreates a health report for SQL Server Service Broker configuration and status.

Backup & Restore 12

CommandDescription
Get-sqmServersFromOUErmittelt alle Computer-Objekte aus einer bestimmten AD-OU und gibt sie als pipefaehige Objekte aus.
Invoke-sqmLogShrinkShrinks the transaction log file (LDF) of one or more databases.
Invoke-sqmRestoreDatabaseRestores a database from a backup file, with support for single-server and AlwaysOn environments.
Invoke-sqmUserDatabaseBackupBacks up user databases on a SQL Server instance.
New-sqmBackupMaintenanceJobCreates a SQL Agent job with two steps that implement the full dynamic backup maintenance workflow.
New-sqmOlaSysDbBackupJobCreates a SQL Agent job for the daily full backup of SQL Server system databases via Ola Hallengren's DatabaseBackup.
New-sqmOlaUsrDbBackupJobCreates SQL Agent jobs for FULL, DIFF, and/or LOG backups of user databases via Ola Hallengren's DatabaseBackup.
Register-sqmBackupExcludeTriggerRegistriert oder entfernt den DDL-Trigger, der master.dbo.sqm_BackupExclude automatisch bei CREATE_DATABASE und DROP_DATABASE aktuell haelt.
Set-sqmBackupExcludePermissionGrants SELECT, INSERT, and UPDATE permissions on master.dbo.sqm_BackupExclude to a login.
Show-sqmBackupExcludeFormWinForms-Dialog zur Verwaltung der Backup-Ausschlusstabelle (master.dbo.sqm_BackupExclude).
Sync-sqmBackupExcludeTableCreates and synchronises the backup exclude table in the master database.
Test-sqmBackupIntegrityVerifies one or more backup files using RESTORE VERIFYONLY.

Security 13

CommandDescription
Enable-sqmMonitoringAccessRichtet einen Monitoring-Account auf allen SQL Server-Instanzen eines Computers ein.
Get-sqmADAccountStatusChecks the status of an Active Directory user account.
Get-sqmADGroupMembersLists all members of an Active Directory group.
Get-sqmADGroupMembersRecursiveLists all members of an Active Directory group with controlled recursion depth.
Get-sqmADMemberGroupsFinds all Active Directory groups that contain a specified user, group, or computer.
Get-sqmLoginSettingsZeigt alle Logins mit Default-Datenbank und Spracheinstellung.
Get-sqmSysadminAccountsRetrieves all logins with sysadmin rights on a SQL Server instance.
Grant-sqmTemporarySysadminVergibt einem AD-Login temporaer sysadmin-Rechte fuer X Tage und entzieht sie danach automatisch ueber einen selbstloeschenden SQL-Agent-Job - bei AlwaysOn failover-robust auf allen Replicas.
Invoke-sqmLoginAuditComprehensive audit of all SQL Server logins on one or more instances.
Invoke-sqmSaObfuscationObfuscates the SA account on a SQL Server instance by renaming it, disabling it, and setting a random password.
Invoke-sqmTempSysadminActionFuehrt die eigentliche sysadmin-Vergabe bzw. -Entziehung auf EINER Instanz aus, legt dabei optional einen fehlenden AD-Login an, entfernt ihn beim Entzug wieder und loescht optional den aufrufenden SQL-Agent-Job nach Erfolg (selbstloeschender Job).
Remove-sqmAdOrphanLoginRemoves Windows logins whose Active Directory account no longer exists (AD orphans).
Set-sqmDatabaseOwnerSets the owner of one or more databases to a uniform login.

Diagnostics & Health 16

CommandDescription
Copy-sqmNTFSPermissionsCopies NTFS permissions (ACLs) from a source path to a destination path.
Get-sqmAgentJobScheduleReportGenerates a comprehensive SQL Agent Job Schedule Report.
Get-sqmConnectionStatsAnalyzes active SQL Server connections and connection statistics.
Get-sqmDatabaseHealthAggregated health report for all databases on an instance.
Get-sqmDiskInfoByDriveLetterReturns disk information for a given drive letter.
Get-sqmDiskPartitionMapZeigt die Zuordnung physischer Datentraeger zu logischen Laufwerksbuchstaben.
Get-sqmDiskSpaceReportDetermines free disk space on all SQL-relevant volumes and estimates time to exhaustion based on a self-collected size history.
Get-sqmOperationStatusDisplays progress and estimated remaining time for active backup, restore and AutoSeed operations.
Get-sqmOrphanedFilesFinds MDF/LDF/NDF database files that are not assigned to any database.
Get-sqmSpnReportChecks the registered SPNs for SQL Server instances (default and named instances).
Get-sqmSQLInstanceCheckChecks a SQL Server instance against best practices.
Get-sqmTempDbRecommendationAnalyzes the TempDB configuration and provides optimization recommendations.
Invoke-sqmPatchAnalysisCompares the installed SQL Server version with known CU/SP builds.
Invoke-sqmSetupReportProfessional SQL Server Setup Report with critical issues, security, and database overview.
New-sqmAgentProxyErstellt einen SQL Server Credential und einen SQL Agent Proxy und verbindet beide.
New-sqmSetupReportBuilds a self-contained animated HTML replay from a setup event JSON-Lines file.

Performance 13

CommandDescription
Get-sqmAutoGrowthReportCreates an AutoGrowth configuration report for all database files on a SQL Server instance.
Get-sqmBlockingReportRetrieves current blocking chains on a SQL Server instance.
Get-sqmDeadlockReportReads and analyzes deadlock events from the System Health Extended Event session.
Get-sqmIndexFragmentationAnalyzes index fragmentation in one or more databases.
Get-sqmLongRunningQueriesIdentifies long-running queries on a SQL Server instance.
Get-sqmMissingIndexesRetrieves missing index recommendations from the SQL Server DMV cache.
Get-sqmPerfCountersReads SQL Server performance counters from sys.dm_os_performance_counters.
Get-sqmServerUtilizationCollects SQL Server CPU and memory utilization trends over time.
Get-sqmWaitStatisticsReads and analyzes SQL Server wait statistics from sys.dm_os_wait_stats.
Invoke-sqmExtendedEventsManages Extended Events sessions for performance analysis on SQL Server.
Invoke-sqmPerfBaselineCreates, compares or lists performance baselines (wait stats + perf counters).
Invoke-sqmQueryStoreConfigures the Query Store, reads from it, detects issues and saves reports.
Invoke-sqmUpdateStatisticsUpdates statistics in one or more databases.

Maintenance 2

CommandDescription
Invoke-sqmFormatDrive64kChecks an NTFS drive for 64 KB allocation unit size and formats it with 65536 byte cluster size if needed.
Invoke-sqmNtfsSetupGrants the SQL Server service accounts NTFS permissions on the instance's data, log, TempDB and backup directories (with an ACL backup beforehand).

SQL Configuration 10

CommandDescription
Compare-sqmServerConfigurationCompares important configuration settings between two SQL Server instances.
Get-sqmServerSettingReads one or all server properties from a SQL Server instance.
Invoke-sqmCollationChangeAutomatically changes the server collation of a SQL Server instance.
Invoke-sqmSetDatabaseRecoveryModeChanges the recovery mode of one or more user databases.
Invoke-sqmSsisConfigurationConfigures SQL Server Integration Services (SSIS) fully automatically. Supports standalone and AlwaysOn AG environments, local and remote.
Set-sqmMaxDopSets MAXDOP (max degree of parallelism) to the recommended (or an explicit) value, and optionally the matching "cost threshold for parallelism".
Set-sqmMaxMemorySets SQL Server "max server memory (MB)" to the recommended (or an explicit) value.
Set-sqmSqlPolicyStateEnables or disables a single Policy-Based Management policy on a SQL Server instance.
Set-sqmSsrsConfigurationConfigures SQL Server Reporting Services (SSRS) fully automatically. Supports local and remote installation as well as AlwaysOn environments.
Set-sqmTcpPortKonfiguriert den TCP-Port einer SQL Server-Instanz ueber die Registry.

sqmTool Config 3

CommandDescription
Get-sqmConfigReturns the current module configuration.
Invoke-sqmMonitoringKeyGets or sets monitoring registry values for the sqmSQLTool on one or more computers.
Set-sqmConfigSets one or more configuration values for the MSSQLTools module.

Inventory & Search 6

CommandDescription
Export-sqmDatabaseDocumentationCreates structured HTML and CSV documentation for all databases on a SQL Server instance.
Export-sqmServerConfigurationExports all SQL Server configuration settings to a JSON snapshot file.
Find-sqmDatabaseObjectSearches all (or selected) databases on an instance for an object name.
Get-sqmLinkedServerUsageAnalyzes which database objects (procedures, functions, views, triggers, SQL Agent jobs) access linked servers.
Invoke-sqmConfigRollbackRestores SQL Server configuration from a previously exported snapshot.
Invoke-sqmInstanceInventoryCreates a complete inventory of a SQL Server instance as a structured report (TXT + CSV).

Cluster & Services 2

CommandDescription
Get-sqmClusterInfoRetrieves information about a Windows Failover Cluster: cluster name, nodes and roles including IP addresses.
Get-sqmHpuAllowGroupSearches for the HPU allow group in Active Directory based on configurable domain/group mappings.

TLS & Certificates 8

CommandDescription
Get-sqmCertificateReportCreates a comprehensive report on SQL Server certificates and their expiration dates.
Get-sqmTlsStatusAudits TLS/SSL configuration and certificate status for all SQL Server instances on one or more computers.
Install-sqmCertificateInstalls a certificate (self-signed or CA-signed) in SQL Server and automatically binds it to the configured purpose.
Install-sqmCertificateToStoreInstalls a certificate file into the Windows certificate store - locally or on multiple remote computers.
New-sqmCertificateRequestCreates a CSR (Certificate Signing Request) and an order data sheet for a CA-signed certificate based on an existing SQL Server certificate.
New-sqmSqlCertificateCreates a new self-signed SQL Server certificate as a renewal of an existing one.
Set-sqmSqlTlsCertificateBinds a Windows certificate from the Machine store to SQL Server as the TLS certificate.
Set-sqmSsrsHttpsCertificateBinds a Windows certificate to SSRS or Power BI Report Server for HTTPS access.

TSM / IBM Spectrum 3

CommandDescription
Get-sqmTsmConfigurationReads the IBM TSM / Spectrum Protect client configuration (dsm.opt) and returns server, user and password settings.
Invoke-sqmTsmConfigurationConfigures the IBM Spectrum Protect (TSM) client options file dsm.opt for use with SQL Server backup directories.
Test-sqmTsmConnectionTests the connection to an IBM Spectrum Protect (TSM) server using dsmadmc.

Driver Install/Uninstall 3

CommandDescription
Install-sqmDb2DriverInstalliert den IBM DB2 ODBC/CLI-Treiber.
Install-sqmJdbcDriverInstalliert den Microsoft JDBC Driver for SQL Server.
Install-sqmOdbcDriverInstalliert den Microsoft ODBC Driver for SQL Server.

Deployment 3

CommandDescription
Install-sqmSsrsReportServerInstalls SQL Server Reporting Services 2022 from a network share and automatically configures the instance afterwards.
Invoke-sqmDeployScriptsExecutes numbered SQL scripts from a directory sequentially against a SQL Server database.
Invoke-sqmSignModuleSigns all PowerShell script files in a module directory using Set-AuthenticodeSignature.

Other 13

CommandDescription
Copy-sqmLoginsCopies logins from a source SQL Server instance to a target instance.
Copy-sqmToCentralPathCopies one or more files to the configured CentralPath.
Get-sqmAgentJobHistoryDisplays the execution history of SQL Agent jobs.
Get-sqmDiskBlockSizeChecks the NTFS block size (cluster size) of drives against 64KB.
Get-sqmServerHardwareReportErstellt einen HTML-Hardware-Konfigurationsbericht fuer einen oder mehrere Server.
Install-sqmAdModuleEnsures that the ActiveDirectory PowerShell module (RSAT) is installed.
Install-sqmOlaMaintenanceSolutionInstalls or updates Ola Hallengren's Maintenance Solution on a SQL Server instance.
install-sqmolammaintenance solution
Invoke-sqmSplunkConfigurationConfigures the Splunk Universal Forwarder on SQL Server hosts.
New-sqmOlaMaintenanceJobsCreates three SQL Agent jobs for Ola Hallengren's Maintenance Solution: IndexOptimize (user DBs) and IntegrityCheck (user and system DBs).
New-sqmRandomSaPasswordGenerates a random, policy-compliant SA password.
repair-sqmalwaysondbases
Show-sqmToolGuiLaunches a small graphical interface (WinForms) for all sqmSQLTool functions.