dbatools Commands
Browse and search 721 PowerShell commands for SQL Server
Add-DbaAgDatabase
⭐Adds databases to an Availability Group and handles the complete process from backup through synchronization. This command eliminates the manual steps typically required when expanding Availability …
Add-DbaAgListener
Creates a network listener endpoint that provides a virtual network name and IP address for clients to connect to an Availability Group. The listener automatically routes client connections to the …
Add-DbaAgReplica
Adds a replica to an availability group on one or more SQL Server instances. Automatically creates database mirroring endpoints if required.
Add-DbaComputerCertificate
Imports X.509 certificates (including password-protected .pfx files with private keys) into the specified Windows certificate store on one or more computers. This function is essential for SQL Server …
Add-DbaDbFile
Adds new data files (.mdf or .ndf) to existing filegroups in SQL Server databases. This is essential after creating new filegroups (especially MemoryOptimizedDataFileGroup for In-Memory OLTP) because …
Add-DbaDbMirrorMonitor
Creates a database mirroring monitor job that periodically updates the mirroring status for every mirrored database on the server instance. Basically executes sp_dbmmonitoraddmonitoring.
Add-DbaDbRoleMember
⭐Manages database security by adding users or roles as members to database roles, automating what would otherwise require manual T-SQL commands or SQL Server Management Studio clicks. This function …
Add-DbaExtendedProperty
Creates custom metadata properties on SQL Server objects to store documentation, version information, business context, or compliance tags. Extended properties are stored in the database system …
Add-DbaInstanceList
Adds SQL Server instance names to a persistent list that pre-populates the tab completion cache for the -SqlInstance parameter across all dbatools commands. This allows users to have their frequently …
Add-DbaPfDataCollectorCounter
Adds specific performance counters to existing Data Collector Sets within Windows Performance Monitor. This allows DBAs to customize their performance monitoring by adding SQL Server-specific counters …
Add-DbaRegServer
Registers SQL Server instances as managed servers within SSMS, either to a Central Management Server (CMS) for enterprise-wide management or to Local Server Groups for personal organization. This …
Add-DbaRegServerGroup
Creates new server groups in SQL Server Central Management Server to organize registered servers into logical hierarchies. This allows DBAs to group servers by environment, application, location, or …
Add-DbaReplArticle
Adds a database object (typically a table) as an article to an existing SQL Server replication publication. Articles define which tables and data get replicated to subscribers. This function supports …
Add-DbaServerRoleMember
Grants server-level role membership to SQL logins or nests server roles within other server roles. Use this command when setting up security permissions, implementing role-based access control, or …
Backup-DbaComputerCertificate
Exports computer certificates from the local or remote certificate store to files on disk. This is essential for backing up certificates used for SQL Server network encryption before server …
Backup-DbaDatabase
⭐Creates full, differential, or transaction log backups for SQL Server databases with support for local file systems, Azure blob storage, and advanced backup features like compression, encryption, and …
Backup-DbaDbCertificate
Backs up database certificates by exporting them to .cer (certificate) and .pvk (private key) files on the SQL Server file system. This is essential for disaster recovery scenarios where you need to …
Backup-DbaDbMasterKey
Creates encrypted backup files of database master keys from one or more SQL Server databases. Database master keys are essential for Transparent Data Encryption (TDE), column-level encryption, and …
Backup-DbaServiceMasterKey
Creates an encrypted backup of the SQL Server Service Master Key (SMK), which sits at the top of SQL Server's encryption hierarchy. The Service Master Key encrypts Database Master Keys and …
Clear-DbaConnectionPool
Clears all SQL Server connection pools managed by the .NET SqlClient on the target computer. This forces any pooled connections to be discarded and recreated on the next connection attempt. Connection …
Clear-DbaLatchStatistics
Clears all accumulated latch statistics from the sys.dm_os_latch_stats dynamic management view by executing DBCC SQLPERF (N'sys.dm_os_latch_stats', CLEAR). This resets counters for latch types like …
Clear-DbaPlanCache
Monitors your SQL Server's plan cache for single-use adhoc and prepared plans that consume excessive memory. When these plans exceed the specified threshold (default 100MB), the function clears the …
Clear-DbaWaitStatistics
Clears all accumulated wait statistics from sys.dm_os_wait_stats by executing DBCC SQLPERF (N'sys.dm_os_wait_stats', CLEAR). This is essential for performance troubleshooting when you need to …
Compare-DbaAgReplicaAgentJob
Compares SQL Agent Jobs across all replicas in an Availability Group to identify differences in job configurations. This helps ensure consistency across AG replicas and detect when jobs have been …
Compare-DbaAgReplicaCredential
Compares SQL Server Credentials across all replicas in an Availability Group to identify differences in credential configurations. This helps ensure consistency across AG replicas and detect when …
Compare-DbaAgReplicaLogin
Compares SQL Server logins across all replicas in an Availability Group to identify differences in login configurations. This helps ensure consistency across AG replicas and detect when logins have …
Compare-DbaAgReplicaOperator
Compares SQL Agent Operators across all replicas in an Availability Group to identify differences in operator configurations. This helps ensure consistency across AG replicas and detect when operators …
Compare-DbaAgReplicaSync
Compares server-level objects across all replicas in an Availability Group to identify differences that would prevent seamless failover. Availability groups only synchronize databases, not the …
Compare-DbaAvailabilityGroup
Compares multiple object types across all replicas in an Availability Group to identify configuration differences. This comprehensive command checks SQL Agent Jobs, SQL Server Logins, SQL Server …
Compare-DbaDbSchema
Uses sqlpackage's DeployReport action to compare a source DACPAC against a target (live database or DACPAC file) and returns a structured list of schema differences. The source must be a DACPAC file. …
Compare-DbaLogin
Compares SQL Server logins between a source instance and one or more destination instances to identify which logins exist only on the source, only on the destination, or on both. This is useful for …
Connect-DbaInstance
⭐This command creates a reusable SQL Server Management Object (SMO) that serves as the foundation for most dbatools operations. Think of it as your entry point for connecting to SQL Server instances, …
ConvertTo-DbaDataTable
Converts PowerShell objects into .NET DataTable objects with proper column types and database-compatible data formatting. This is essential for bulk operations like importing data into SQL Server …
ConvertTo-DbaTimeline
Transforms SQL Server job execution, backup operation, and database growth event data into visual timeline reports for analysis and troubleshooting. Takes piped output from Get-DbaAgentJobHistory, …
ConvertTo-DbaXESession
Converts existing SQL Server Traces to Extended Events sessions by analyzing trace definitions and mapping events, columns, actions, and filters to their Extended Events equivalents. This eliminates …
Copy-DbaAgentAlert
Transfers SQL Server Agent alerts from a source instance to one or more destination instances, preserving their configurations, notification settings, and job associations. This function handles the …
Copy-DbaAgentJob
⭐Copies SQL Server Agent jobs from one instance to another while automatically validating all dependencies including databases, logins, proxy accounts, and operators. This eliminates the manual process …
Copy-DbaAgentJobCategory
Migrates custom SQL Agent categories from a source SQL Server to one or more destination servers, so you don't have to manually recreate organizational structures during server migrations or …
Copy-DbaAgentJobStep
Synchronizes SQL Server Agent job steps between instances by copying step definitions from source jobs to destination jobs. Unlike Copy-DbaAgentJob with -Force, this command preserves job execution …
Copy-DbaAgentOperator
Copies SQL Server Agent operators from a source instance to one or more destination instances, preserving all operator properties including email addresses, pager numbers, and notification schedules. …
Copy-DbaAgentProxy
Migrates SQL Server Agent proxy accounts between instances, enabling job steps to run under different security contexts than the SQL Agent service account. By default, all proxy accounts are copied, …
Copy-DbaAgentSchedule
Copies shared job schedules (not job-specific schedules) from the source SQL Server Agent to one or more destination instances using T-SQL scripting. This is essential when standardizing job schedules …
Copy-DbaAgentServer
Migrates complete SQL Server Agent configuration including jobs, operators, alerts, schedules, job categories, and proxies from one instance to another. This function handles the proper sequence of …
Copy-DbaBackupDevice
Copies SQL Server backup devices from one instance to another, handling both the logical device definition and the physical backup files. This simplifies server migrations and disaster recovery setup …
Copy-DbaCredential
⭐Copies SQL Server credentials from source to destination instances without losing the original passwords, which normally can't be retrieved through standard methods. This function uses a Dedicated …
Copy-DbaCustomError
Copies user-defined error messages from the source server's sys.messages system catalog to one or more destination servers. This is essential when migrating applications that rely on custom error …
Copy-DbaDatabase
⭐Moves user databases from one SQL Server instance to another, supporting both on-premises and Azure SQL Managed Instance destinations. Ideal for server migrations, environment refreshes, disaster …
Copy-DbaDataCollector
Copies SQL Data Collector collection sets between SQL Server instances, allowing you to replicate performance monitoring configurations across your environment. This command scripts out the collection …
Copy-DbaDbAssembly
Migrates custom CLR assemblies from databases on a source SQL Server to corresponding databases on destination instances. This function scans all accessible databases for user-created assemblies and …
Copy-DbaDbCertificate
Transfers database certificates between SQL Server instances by backing them up from source databases and restoring them to matching databases on destination servers. This function handles the complex …
Copy-DbaDbMail
⭐Migrates the complete Database Mail setup from a source SQL Server to one or more destination servers. This includes mail profiles (which group accounts for specific purposes), mail accounts (SMTP …
Copy-DbaDbQueryStoreOption
Reads the complete Query Store configuration from a source database and applies those exact settings to specified destination databases. This lets you standardize Query Store behavior across your …
Copy-DbaDbTableData
⭐Copies data between SQL Server tables using SQL Bulk Copy for maximum performance and minimal memory usage. Unlike Invoke-DbaQuery and Write-DbaDbTableData which buffer entire table contents in …
Copy-DbaDbViewData
Extracts data from SQL Server views and bulk copies it to destination tables, either on the same instance or across different servers. Uses SqlBulkCopy for optimal performance when migrating view …
Copy-DbaEndpoint
Migrates user-defined endpoints (excluding system endpoints) from a source SQL Server to one or more destination servers. This includes Service Broker, Database Mirroring, and Availability Group …
Copy-DbaExtendedStoredProcedure
Migrates custom Extended Stored Procedures from the source server to one or more destination servers. Extended Stored Procedures are DLL-based procedures that extend SQL Server functionality by …
Copy-DbaInstanceAudit
Migrates SQL Server audit objects and their configurations from one instance to another, preserving audit settings and file paths. This function handles the complex task of recreating audit …
Copy-DbaInstanceAuditSpecification
Migrates server audit specifications between SQL Server instances, allowing DBAs to standardize audit configurations across environments or restore audit settings during disaster recovery. The …
Copy-DbaInstanceTrigger
Migrates server-level triggers from a source SQL Server instance to one or more destination instances. This is essential during server migrations, disaster recovery setup, or when standardizing …
Copy-DbaLinkedServer
⭐Migrates SQL Server linked servers including all authentication credentials and connection settings from a source instance to one or more destination instances. The function preserves usernames and …
Copy-DbaLogin
⭐Transfers SQL Server logins from one instance to another while preserving authentication details and security context. Essential for server migrations, disaster recovery setups, and environment …
Copy-DbaPolicyManagement
Transfers your entire Policy-Based Management framework from one SQL Server instance to another, including custom policies, conditions, object sets, and categories. This streamlines environment …
Copy-DbaRegServer
Migrates registered servers and server groups from a source Central Management Server to a destination CMS, preserving the hierarchical structure of groups and subgroups. This eliminates the need to …
Copy-DbaResourceGovernor
Migrates your entire SQL Server Resource Governor setup from one instance to another, including custom resource pools, workload groups, and classifier functions. This saves you from manually …
Copy-DbaServerRole
Copies user-defined server roles from the source server to one or more destination servers. This is essential when migrating SQL Server instances that use custom server roles for granular permission …
Copy-DbaSpConfigure
This function retrieves all sp_configure settings from the source SQL Server and applies them to one or more destination instances, ensuring consistent configuration across your environment. Only …
Copy-DbaSsisCatalog
Copies the complete SSISDB catalog structure from a source SQL Server to one or more destination instances. This function handles server migrations, environment promotions, and disaster recovery …
Copy-DbaStartupProcedure
Migrates user-defined startup procedures stored in the master database from source to destination SQL Server instances. Startup procedures are stored procedures that automatically execute when SQL …
Copy-DbaSystemDbUserObject
Migrates custom database objects that DBAs commonly store in system databases like maintenance procedures, monitoring tables, custom triggers, and backup utilities from master and msdb. Also transfers …
Copy-DbaXESession
Copies custom Extended Event sessions between SQL Server instances while preserving their configuration and running state. This function scripts out the session definitions from the source server and …
Copy-DbaXESessionTemplate
Installs curated Extended Event session templates into SQL Server Management Studio's template directory so you can access them through the SSMS GUI. The templates include common monitoring scenarios …
Disable-DbaAgHadr
Disables the HADR service setting at the SQL Server instance level, effectively removing the instance's ability to participate in Availability Groups. This is commonly needed when decommissioning …
Disable-DbaDbEncryption
Disables Transparent Data Encryption (TDE) on specified databases by setting EncryptionEnabled to false and monitoring the decryption process until completion. Since TDE is not fully disabled until …
Disable-DbaFilestream
Disables the FileStream feature completely by setting the FilestreamAccessLevel configuration to 0 (disabled) and modifying the corresponding Windows service settings. This is useful when FileStream …
Disable-DbaForceNetworkEncryption
Modifies the Windows registry to disable Force Network Encryption for SQL Server instances, allowing unencrypted client connections. This is useful when troubleshooting connectivity issues, working …
Disable-DbaHideInstance
Modifies the Windows registry to disable the Hide Instance setting, making SQL Server instances visible to the SQL Server Browser service and network discovery tools. When Hide Instance is enabled, …
Disable-DbaReplDistributor
Removes the distribution database and configuration from SQL Server instances currently acting as replication distributors. This command terminates active connections to distribution databases and …
Disable-DbaReplPublishing
Removes the publisher role from SQL Server instances that are currently configured for replication publishing. This function safely dismantles the publishing configuration by removing the publisher …
Disable-DbaStartupProcedure
Prevents stored procedures from automatically executing when the SQL Server service starts by clearing their startup designation in the master database. This is essential when troubleshooting startup …
Disable-DbaTraceFlag
Turns off trace flags that are currently enabled globally across SQL Server instances using DBCC TRACEOFF. Useful when you need to disable diagnostic trace flags that were enabled for troubleshooting …
Disconnect-DbaInstance
Properly closes SQL Server connections created by dbatools commands like Connect-DbaInstance, preventing connection leaks and freeing up server connection limits. This function handles both SMO server …
Dismount-DbaDatabase
Safely detaches databases from SQL Server instances while performing comprehensive validation checks before detachment. This function automatically validates that databases aren't system databases, …
Enable-DbaAgHadr
Configures the High Availability Disaster Recovery (HADR) service setting on SQL Server instances, which is a required prerequisite before you can create Availability Groups. This setting must be …
Enable-DbaDbEncryption
Enables Transparent Data Encryption (TDE) on specified databases to protect data at rest. This is essential for compliance with regulations like HIPAA, PCI-DSS, and organizational security policies. …
Enable-DbaFilestream
Configures SQL Server's FILESTREAM feature by setting the FilestreamAccessLevel at the instance level and enabling the Windows service component at the server level. The function supports three access …
Enable-DbaForceNetworkEncryption
Modifies the Windows registry to force all client connections to SQL Server to use encryption, regardless of the client's encryption settings. This security feature ensures that all data transmitted …
Enable-DbaHideInstance
Enables the Hide Instance setting in the SQL Server network configuration registry, which prevents the instance from responding to SQL Server Browser service enumeration requests. This security …
Enable-DbaReplDistributor
Configures the specified SQL Server instance to act as a replication distributor by creating the distribution database and installing the distributor role. This is the first step in setting up SQL …
Enable-DbaReplPublishing
Configures a SQL Server instance to publish data for replication by creating the necessary publisher configuration on an existing distributor. This is typically the second step in setting up SQL …
Enable-DbaStartupProcedure
Marks stored procedures in the master database for automatic execution during SQL Server startup, eliminating the need to manually run initialization scripts after service restarts. This is essential …
Enable-DbaTraceFlag
Activates trace flags at the global level using DBCC TRACEON, affecting all connections and sessions on the target SQL Server instances. Commonly used for troubleshooting performance issues, enabling …
Expand-DbaDbLogFile
This function intelligently grows transaction log files to target sizes while minimizing Virtual Log File (VLF) fragmentation. It calculates optimal increment sizes based on your SQL Server version …
Export-DbaBinaryFile
Retrieves binary data stored in SQL Server tables and writes it as files to the filesystem. This is useful for extracting documents, images, or other files that have been stored in database columns …
Export-DbaCredential
Exports SQL Server credentials to T-SQL files containing CREATE CREDENTIAL statements that can recreate the credentials on another instance. By default, this includes decrypted passwords, making it …
Export-DbaCsv
Export-DbaCsv provides high-performance CSV export capabilities with support for multiple compression formats including GZip, Deflate, Brotli, and ZLib. The function can export data from SQL queries, …
Export-DbaDacPackage
Creates database deployment packages for version control, migrations, and schema distribution. Generates DACPAC files containing database schema definitions or BACPAC files that include both schema …
Export-DbaDbRole
Creates executable T-SQL scripts that fully define database roles including CREATE ROLE statements, granular object permissions, and schema ownership assignments. The output captures every permission …
Export-DbaDbTableData
⭐Creates executable INSERT statements from existing table data, making it easy to move data between SQL Server instances or environments. This is particularly useful for migrating reference tables, …
Export-DbaDiagnosticQuery
Processes the PowerShell objects returned by Glenn Berry's diagnostic queries and saves them as CSV files or Excel worksheets for analysis, reporting, and sharing with vendors. Automatically extracts …
Export-DbaExecutionPlan
Queries the SQL Server plan cache using dynamic management views and exports execution plans as XML files with .sqlplan extensions. These files can be opened directly in SQL Server Management Studio …
Export-DbaInstance
⭐Export-DbaInstance consolidates most of the export scripts in dbatools into one command that captures everything needed to recreate or migrate a SQL Server instance. This command saves hours of manual …
Export-DbaLinkedServer
Creates executable T-SQL scripts from existing linked server definitions, including remote login mappings and passwords. Perfect for migrating linked servers between environments, creating disaster …
Export-DbaLogin
⭐Creates executable T-SQL scripts that recreate SQL Server and Windows logins along with their complete security configuration. The export includes login properties (SID, hashed passwords, default …
Export-DbaPfDataCollectorSetTemplate
Exports Data Collector Set configurations from Windows Performance Monitor as XML template files that can be imported on other SQL Server hosts. This allows you to standardize performance monitoring …
Export-DbaRegServer
Exports registered servers and registered server groups to file
Export-DbaReplServerSetting
Creates T-SQL scripts that can recreate your SQL Server replication setup, including distributor configuration, publications, subscriptions, and all related settings. The generated scripts include …
Export-DbaScript
⭐Takes any SQL Server Management Object from dbatools commands and converts it into executable T-SQL CREATE scripts using SMO scripting. This lets you script out database objects like tables, jobs, …
Export-DbaServerRole
Creates complete T-SQL scripts that can recreate server-level roles along with their permissions and memberships on another instance. This eliminates the need to manually recreate security …
Export-DbaSpConfigure
Creates a complete SQL script file with EXEC sp_configure statements for all server configuration options, including advanced settings. This script can be executed on another SQL Server instance to …
Export-DbaSysDbUserObject
Scans the master, model, and msdb system databases to identify tables, views, stored procedures, functions, triggers, and other objects that were created by users rather than SQL Server itself. This …
Export-DbatoolsConfig
Exports dbatools configuration settings to a JSON file, allowing you to backup your current settings or migrate them to other machines. This function captures customized settings like connection …
Export-DbaUser
⭐Creates comprehensive T-SQL scripts that fully recreate database users along with their security assignments and permissions. The generated scripts include user creation statements, role memberships, …
Export-DbaXESession
Generates T-SQL scripts that can recreate your Extended Events sessions, making it easy to migrate monitoring configurations between environments or create backups of your XE session definitions. This …
Export-DbaXESessionTemplate
Converts existing Extended Events sessions into XML template files that can be imported and reused in SQL Server Management Studio. This lets you standardize XE session configurations across multiple …
Find-DbaAgentJob
Searches SQL Agent jobs across one or more SQL Server instances using various filter criteria including job name, step name, execution status, schedule status, and notification settings. Helps DBAs …
Find-DbaBackup
Recursively scans specified directories to locate SQL Server backup files (.bak, .trn, .dif, etc.) older than your defined retention period. Returns file objects that can be piped to removal commands …
Find-DbaCommand
Finds dbatools commands searching through the inline help text, building a consolidated json index and querying it because Get-Help is too slow
Find-DbaDatabase
Performs database discovery and inventory across multiple SQL Server instances by searching for databases that match specific criteria. You can search by database name (using regex patterns), database …
Find-DbaDbDisabledIndex
Scans SQL Server databases to locate indexes that have been disabled, returning detailed information including database, schema, table, and index names. Disabled indexes consume storage space but …
Find-DbaDbDuplicateIndex
Scans database tables to identify indexes that have identical or overlapping column structures, which consume unnecessary storage space and slow down insert, update, and delete operations. Duplicate …
Find-DbaDbGrowthEvent
Queries the SQL Server Default Trace to identify when database files have automatically grown or shrunk, providing detailed timing and size change information essential for performance troubleshooting …
Find-DbaDbUnusedIndex
Analyzes index usage statistics from sys.dm_db_index_usage_stats to identify indexes with minimal activity that consume storage space and slow down data modifications without providing query …
Find-DbaInstance
⭐This function performs comprehensive SQL Server instance discovery across your network infrastructure using multiple detection methods. Perfect for creating complete SQL Server inventories, compliance …
Find-DbaLoginInGroup
Connects to SQL Server instances and recursively expands all Windows Active Directory group logins to reveal the individual user accounts that inherit access through group membership. This function …
Find-DbaObject
Provides a unified search across all database object types (tables, views, stored procedures, functions, synonyms, triggers) by matching their names against a regex pattern. Optionally extends the …
Find-DbaOrphanedFile
Scans filesystem directories for database files (.mdf, .ldf, .ndf) that exist on disk but are not currently attached to the SQL Server instance. This is essential for cleanup operations after database …
Find-DbaSimilarTable
Analyzes table and view structures across databases by comparing column names using INFORMATION_SCHEMA views. Returns a match percentage showing how similar structures are based on shared column …
Find-DbaStoredProcedure
Searches through stored procedure source code to find specific strings, patterns, or regex expressions within the procedure definitions. This is particularly useful for finding hardcoded values, …
Find-DbaTrigger
Searches through SQL Server trigger definitions to find specific text patterns, supporting both literal strings and regular expressions. Examines triggers at three levels: server-level triggers, …
Find-DbaUserObject
Scans SQL Server instances to identify objects with non-standard ownership, which is critical for security auditing and user management. When removing user accounts or performing security reviews, you …
Find-DbaView
Scans view definitions across one or more databases to locate specific text patterns, table references, or code constructs. This helps DBAs identify views that reference particular tables before …
Format-DbaBackupInformation
Takes backup history objects from Select-DbaBackupInformation and transforms them for restore scenarios where you need to change database names, file locations, or backup paths. This is essential for …
Get-DbaAgBackupHistory
Queries the msdb backup history tables across all replicas in an Availability Group and aggregates the results into a unified view. This function automatically discovers all replicas (either through a …
Get-DbaAgDatabase
Retrieves detailed information about databases participating in SQL Server availability groups, including their synchronization state, failover readiness, and replica-specific status. This function …
Get-DbaAgDatabaseReplicaState
Retrieves comprehensive health monitoring information about databases participating in SQL Server availability groups, similar to the SSMS AG Dashboard. This function returns detailed database replica …
Get-DbaAgentAlert
Retrieves alert configurations from SQL Server Agent, including alert names, types, severity levels, message IDs, and notification settings. Use this to audit alert configurations across multiple …
Get-DbaAgentAlertCategory
Retrieves all SQL Server Agent alert categories from the target instances, showing how alerts are organized and grouped. Categories help DBAs manage alerts logically by grouping related notifications …
Get-DbaAgentJob
⭐Retrieves detailed information about SQL Server Agent jobs including their configuration, status, schedules, and execution history. This function connects to SQL instances and queries the msdb …
Get-DbaAgentJobCategory
Returns SQL Server Agent job categories from one or more instances, showing how many jobs are assigned to each category. Job categories help organize and group related SQL Agent jobs for easier …
Get-DbaAgentJobHistory
Get-DbaAgentJobHistory queries the msdb database to retrieve detailed execution records for SQL Server Agent jobs, helping you troubleshoot failures, monitor performance trends, and generate …
Get-DbaAgentJobOutputFile
This function returns the file paths where SQL Agent job steps write their output logs. When troubleshooting failed jobs or reviewing execution history, DBAs often need to locate these output files to …
Get-DbaAgentJobStep
Collects comprehensive details about SQL Agent job steps across one or more SQL Server instances. Returns information about each step's subsystem type, last execution date, outcome, and current state, …
Get-DbaAgentLog
Retrieves SQL Server Agent error log entries from the target instance, providing detailed information about agent service activity, job failures, and system events. This function accesses the agent's …
Get-DbaAgentOperator
Retrieves detailed information about SQL Server Agent operators, including email addresses, enabled status, and relationships to jobs and alerts that notify them. Essential for auditing notification …
Get-DbaAgentProxy
Retrieves SQL Server Agent proxy accounts which allow job steps to execute under different security contexts than the SQL Agent service account. This function is essential for security auditing, …
Get-DbaAgentSchedule
Retrieves all shared schedules from SQL Server Agent along with human-readable descriptions of their timing patterns. These shared schedules can be reused across multiple jobs to standardize …
Get-DbaAgentServer
Returns detailed SQL Server Agent configuration including service state, logging levels, job history settings, and service accounts. This is essential for auditing Agent configurations across multiple …
Get-DbaAgHadr
Checks whether Availability Groups are enabled at the service level on SQL Server instances. This is a prerequisite for creating and managing Availability Groups, as HADR must be enabled before you …
Get-DbaAgListener
Retrieves availability group listener configurations from SQL Server instances, providing essential network details needed for client connections and troubleshooting. This function returns listener …
Get-DbaAgReplica
⭐Retrieves detailed information about availability group replicas including their current role, connection state, synchronization status, and failover configuration. This function helps DBAs monitor …
Get-DbaAgRingBuffer
This command queries sys.dm_os_ring_buffers for HADR-specific ring buffer types to provide diagnostic information about Always On availability groups. These ring buffers record state transitions, role …
Get-DbaAvailabilityGroup
⭐Retrieves detailed Availability Group information including replica roles, cluster configuration, database membership, and listener details from SQL Server 2012+ instances. This command helps DBAs …
Get-DbaAvailableCollation
Returns the complete list of collations supported by each SQL Server instance, along with their associated code page names, locale descriptions, and detailed properties. This information is essential …
Get-DbaBackupDevice
This function returns all backup devices configured on SQL Server instances, including their type (disk, tape, URL), physical locations, and settings. Backup devices are logical names that map to …
Get-DbaBackupInformation
Reads the headers of SQL Server backup files to extract metadata and creates BackupHistory objects compatible with Restore-DbaDatabase. This eliminates the need to manually track backup chains and …
Get-DbaBinaryFileTable
Scans database tables to find those containing binary data columns (binary, varbinary, image) and automatically identifies potential filename columns for file extraction workflows. This function is …
Get-DbaBuild
⭐Identifies the specific build version of SQL Server instances and translates build numbers into meaningful patch levels with their corresponding KB articles. This function helps DBAs quickly determine …
Get-DbaClientAlias
Retrieves all configured SQL Server client aliases by reading the Windows registry paths where SQL Server Native Client stores alias definitions. Client aliases allow DBAs to create friendly names …
Get-DbaClientProtocol
Retrieves the configuration and status of SQL Server client network protocols (Named Pipes, TCP/IP, Shared Memory, VIA) from local or remote computers. This function helps DBAs audit and troubleshoot …
Get-DbaCmConnection
Shows which remote computer connections are currently cached by dbatools for Windows Management and CIM operations. This helps you understand what authentication contexts are active and troubleshoot …
Get-DbaCmObject
Queries Windows Management Instrumentation (WMI) or Common Information Model (CIM) classes on SQL Server hosts to gather system-level information like hardware specs, operating system details, …
Get-DbaComputerCertificate
Scans Windows certificate stores to find X.509 certificates suitable for enabling SQL Server network encryption. By default, returns only certificates with Server Authentication capability from the …
Get-DbaComputerSystem
Collects detailed system specifications including processor details, memory configuration, domain membership, and hardware information from target computers. This function is essential for SQL Server …
Get-DbaConnectedInstance
Shows all SQL Server connections that are currently active or cached in your PowerShell session. When you connect to instances using dbatools commands like Connect-DbaInstance, those connections are …
Get-DbaConnection
Returns a bunch of information from dm_exec_connections which, according to Microsoft: "Returns information about the connections established to this instance of SQL Server and the details of each …
Get-DbaCpuRingBuffer
This command queries sys.dm_os_ring_buffers to extract detailed CPU utilization history for performance troubleshooting and capacity planning. Based on Glen Berry's diagnostic query, it provides …
Get-DbaCpuUsage
When CPU usage is high on your SQL Server, it can be difficult to pinpoint which specific SQL queries or processes are responsible using standard SQL Server tools alone. This function bridges that gap …
Get-DbaCredential
Retrieves SQL Server Credentials that are stored securely on the server and used by SQL Server services to authenticate to external resources like file shares, web services, or other SQL Server …
Get-DbaCustomError
Retrieves all custom error messages that have been added to SQL Server using sp_addmessage or through SQL Server Management Studio. These user-defined error messages are stored in the sys.messages …
Get-DbaDatabase
⭐Retrieves detailed database information from one or more SQL Server instances, returning rich database objects instead of basic metadata queries. This command provides comprehensive filtering options …
Get-DbaDbAssembly
Retrieves detailed information about Common Language Runtime (CLR) assemblies that have been registered in SQL Server databases. This function helps DBAs audit custom .NET assemblies for security …
Get-DbaDbAsymmetricKey
Retrieves asymmetric keys stored in SQL Server databases, including their encryption algorithms, key lengths, owners, and thumbprints. This function is essential for security audits and encryption key …
Get-DbaDbBackupHistory
⭐Queries the MSDB database backup tables to extract detailed backup history information including file paths, sizes, compression ratios, and LSN sequences. Essential for compliance auditing, disaster …
Get-DbaDbccHelp
Executes DBCC HELP against SQL Server to display syntax, parameters, and usage information for Database Console Commands. This saves you from having to look up DBCC command syntax in documentation, …
Get-DbaDbccMemoryStatus
Runs DBCC MEMORYSTATUS against SQL Server instances and parses the output into a structured PowerShell object for analysis. This replaces the need to manually execute DBCC MEMORYSTATUS and interpret …
Get-DbaDbccProcCache
Executes DBCC PROCCACHE against SQL Server instances and returns structured information about plan cache memory utilization. This command reveals how much memory is allocated for storing compiled …
Get-DbaDbccSessionBuffer
Executes DBCC INPUTBUFFER or DBCC OUTPUTBUFFER to examine what SQL statements a session is executing or what data is being returned to a client. InputBuffer shows the last SQL batch sent by a client …
Get-DbaDbccStatistic
Executes DBCC SHOW_STATISTICS to extract detailed information about statistics objects, including distribution histograms, density vectors, and header information. This helps DBAs diagnose query …
Get-DbaDbccUserOption
Executes DBCC USEROPTIONS against SQL Server instances to display current session settings including ANSI options, isolation levels, date formats, language, and timeout values. This is particularly …
Get-DbaDbCertificate
Retrieves all certificates stored within SQL Server databases, providing detailed information about each certificate including expiration dates, issuers, and encryption properties. This function is …
Get-DbaDbCheckConstraint
Gets database Checks constraints.
Get-DbaDbCompatibility
Returns the current compatibility level setting for each database, which determines what SQL Server language features and behaviors are available to that database. This is essential when planning SQL …
Get-DbaDbCompression
This function analyzes data compression usage across your SQL Server databases by examining tables, indexes, and their physical partitions. It returns detailed information including current …
Get-DbaDbDataClassification
Retrieves data classification labels stored as extended properties on table columns. Data classification is used to tag sensitive data columns with information type and sensitivity labels, which helps …
Get-DbaDbDbccOpenTran
Executes DBCC OPENTRAN against specified databases to identify long-running or problematic transactions that may be causing blocking, transaction log growth, or replication delays. This function helps …
Get-DbaDbDetachedFileInfo
Analyzes detached MDF files to retrieve essential database metadata including name, SQL Server version, collation, and complete file structure. This lets you examine database files sitting in storage …
Get-DbaDbEncryption
Audits database-level encryption across SQL Server instances by examining TDE encryption status, certificates, asymmetric keys, and symmetric keys within each database. Returns detailed information …
Get-DbaDbEncryptionKey
Retrieves detailed information about Transparent Data Encryption (TDE) database encryption keys including encryption state, algorithm, and certificate details. This function helps DBAs audit encrypted …
Get-DbaDbExtentDiff
Analyzes database extents to determine how much data has changed since the last full backup, helping DBAs decide between differential and full backup strategies. The function examines extent-level …
Get-DbaDbFeatureUsage
Queries the sys.dm_db_persisted_sku_features dynamic management view to identify SQL Server Enterprise features that are actively used in your databases. This is essential when planning to downgrade …
Get-DbaDbFile
Retrieves detailed information about database files (data and log files) from SQL Server instances using direct T-SQL queries for optimal performance. This function provides comprehensive file …
Get-DbaDbFileGroup
Retrieves detailed filegroup information from one or more databases, including filegroup type, size, and configuration details. This function helps DBAs analyze database storage organization, plan …
Get-DbaDbFileGrowth
Retrieves auto-growth configuration for data and log files across SQL Server databases, including growth type (percentage or fixed MB), growth increment values, and maximum size limits. This function …
Get-DbaDbFileMapping
Extracts the logical-to-physical file name mappings from an existing database and returns them in a hashtable format compatible with Restore-DbaDatabase. This eliminates the need to manually specify …
Get-DbaDbForeignKey
Retrieves all foreign key constraint definitions from tables across one or more SQL Server databases. Essential for documenting referential integrity relationships, analyzing table dependencies before …
Get-DbaDbIdentity
Executes DBCC CHECKIDENT with the NORESEED option to retrieve current identity seed and column values from specified tables without modifying anything. This provides a safe way to inspect identity …
Get-DbaDbLogShipError
Queries the log shipping monitor error detail table in msdb to return comprehensive error information when log shipping operations fail. Identifies which specific action failed (backup on primary, …
Get-DbaDbLogSpace
Collects detailed transaction log metrics including total size, used space percentage, and used space in bytes for databases across SQL Server instances. Uses the sys.dm_db_log_space_usage DMV on SQL …
Get-DbaDbMail
Retrieves the complete Database Mail configuration from one or more SQL Server instances, including mail profiles, SMTP accounts, configuration values, and properties. This function provides a quick …
Get-DbaDbMailAccount
Retrieves Database Mail account configurations including email addresses, display names, SMTP server settings, and authentication details from SQL Server instances. This function helps DBAs audit …
Get-DbaDbMailConfig
Retrieves all Database Mail configuration values from SQL Server, including settings like MaxFileSize, ProhibitedExtensions, DatabaseMailExeMinLifeTime, and LoggingLevel. This function helps DBAs …
Get-DbaDbMailHistory
Retrieves comprehensive Database Mail history from the msdb.dbo.sysmail_allitems table, including delivery status, recipients, subject lines, and timestamps. This function helps DBAs troubleshoot …
Get-DbaDbMailLog
Retrieves Database Mail event logs from the msdb.dbo.sysmail_event_log table, providing detailed information about email send attempts, failures, and system events. This function is essential for …
Get-DbaDbMailProfile
Retrieves Database Mail profiles from one or more SQL Server instances, returning detailed configuration information for each profile including ID, name, description, and status properties. This …
Get-DbaDbMailServer
Retrieves detailed SMTP server configuration information from all Database Mail accounts on SQL Server instances. This function pulls the actual mail server settings including port numbers, SSL …
Get-DbaDbMasterKey
Retrieves database master key objects and their metadata from one or more SQL Server databases. Database master keys are used to encrypt sensitive data through features like Transparent Data …
Get-DbaDbMemoryUsage
Analyzes SQL Server buffer pool memory usage by querying sys.dm_os_buffer_descriptors to show exactly how much memory each database consumes, broken down by page type (data pages, index pages, etc.). …
Get-DbaDbMirror
This command collects detailed mirroring information from databases configured with SQL Server Database Mirroring, including partner servers, witness servers, safety levels, and synchronization …
Get-DbaDbMirrorMonitor
Retrieves detailed database mirroring performance statistics from the msdb monitoring tables, helping you track mirroring health and identify performance bottlenecks. This function executes …
Get-DbaDbObjectTrigger
Retrieves all DML triggers that are attached to tables and views within specified databases. This function helps DBAs inventory trigger-based business logic, identify potential performance …
Get-DbaDbOrphanUser
An orphan user is defined by a user that does not have their matching login. (Login property = ""). Note: Users in contained databases (Partial or Full containment type) are not considered orphaned …
Get-DbaDbPageInfo
This function queries the sys.dm_db_database_page_allocations dynamic management view to return detailed information about page allocation, including page type, free space percentage, allocation …
Get-DbaDbPartitionFunction
Retrieves partition function definitions and their metadata from one or more SQL Server databases. Partition functions define how table or index data is distributed across multiple partitions based on …
Get-DbaDbPartitionScheme
Retrieves partition scheme objects from one or more SQL Server databases, providing details about how partitioned tables and indexes are distributed across filegroups. Partition schemes define the …
Get-DbaDbQueryStoreOption
Returns the complete Query Store configuration for user databases, including capture modes, storage limits, cleanup policies, and retention settings. This function helps DBAs audit Query Store …
Get-DbaDbRecoveryModel
Retrieves recovery model configuration for databases along with their last backup dates, which is essential for backup strategy planning and compliance auditing. DBAs use this to identify databases …
Get-DbaDbRestoreHistory
Queries the MSDB database's restorehistory and backupset tables to retrieve detailed information about all database restore operations performed on a SQL Server instance. This function returns …
Get-DbaDbRole
Retrieves all database roles (both fixed and custom) from one or more SQL Server databases, returning detailed role information for security audits and compliance reporting. This function examines the …
Get-DbaDbRoleMember
This function enumerates the membership of database roles, showing which users and nested roles belong to each role. Essential for security audits, permission troubleshooting, and compliance …
Get-DbaDbSchema
Returns SQL Server Management Object (SMO) schema objects from one or more databases, allowing you to inspect schema ownership, enumerate database organization, and identify schema-level security …
Get-DbaDbSequence
Retrieves sequence objects from SQL Server databases, returning detailed information about each sequence including data type, start value, increment value, and schema location. Sequences provide a …
Get-DbaDbServiceBrokerQueue
Gets database Sservice broker queue
Get-DbaDbServiceBrokerService
Retrieves detailed information about Service Broker services configured in SQL Server databases, including service names, associated queues, schemas, and ownership details. Service Broker services …
Get-DbaDbSharePoint
Discovers and returns database objects for all databases that are part of a SharePoint farm by querying the SharePoint Configuration database's internal tables and stored procedures. This helps DBAs …
Get-DbaDbSnapshot
Collects information about all database snapshots on a SQL Server instance, showing which database each snapshot was created from, when it was created, and how much disk space it's consuming. This is …
Get-DbaDbSpace
Queries sys.database_files and FILEPROPERTY to return comprehensive space information for data and log files across databases. Shows current usage, available free space, autogrowth configuration, and …
Get-DbaDbState
Gets three key database state properties from sys.databases that DBAs frequently need to check: - "RW" options: READ_ONLY or READ_WRITE (whether database accepts modifications) - "Status" options: …
Get-DbaDbStoredProcedure
Retrieves stored procedures from one or more SQL Server databases, returning detailed information including schema, creation dates, and implementation details. This function helps DBAs inventory …
Get-DbaDbSynonym
Returns database synonym objects along with their target object details including base server, database, schema, and object name. Synonyms are database-scoped aliases that point to objects in the same …
Get-DbaDbTable
⭐Returns detailed table information including row counts, space usage (IndexSpaceUsed, DataSpaceUsed), and special table characteristics like memory optimization, partitioning, and FileTable status. …
Get-DbaDbTrigger
Retrieves all database-level DDL triggers from one or more SQL Server instances. Database triggers fire in response to DDL events like CREATE, ALTER, or DROP statements within a specific database, …
Get-DbaDbUdf
Retrieves all User Defined Functions (UDFs) and User Defined Aggregates from one or more SQL Server databases, returning detailed metadata including schema, creation dates, and data types. This …
Get-DbaDbUser
⭐Retrieves all database user accounts from one or more databases, showing their associated server logins, authentication types, and access states. This function is essential for security audits, user …
Get-DbaDbUserDefinedTableType
Retrieves user-defined table types from SQL Server databases, which are custom data types used as table-valued parameters in stored procedures and functions. This command helps DBAs audit these …
Get-DbaDbView
Retrieves all database views from SQL Server instances along with their schema, creation dates, and modification timestamps. This helps DBAs document database architecture, analyze view dependencies, …
Get-DbaDbVirtualLogFile
This function uses DBCC LOGINFO to return detailed metadata about each virtual log file (VLF) within database transaction logs. The output includes VLF size, file offsets, sequence numbers, status, …
Get-DbaDefaultPath
Retrieves the default directory paths that SQL Server uses for new database files, transaction logs, backups, and error logs. This information is essential for capacity planning, automated database …
Get-DbaDependency
This function discovers SQL Server object dependencies using SMO (SQL Server Management Objects) and returns detailed information including creation scripts and deployment order. By default, it finds …
Get-DbaDeprecatedFeature
Queries the sys.dm_os_performance_counters system view to identify which deprecated SQL Server features have been used on your instances and how frequently they've been accessed. This information is …
Get-DbaDiskSpace
⭐Queries Windows disk volumes on SQL Server systems using WMI to gather critical storage information for database administration. Returns comprehensive disk details including capacity, free space, …
Get-DbaDump
Queries the sys.dm_server_memory_dumps dynamic management view to return details about memory dump files (.mdmp) generated by SQL Server. Memory dumps are created when SQL Server encounters crashes, …
Get-DbaEndpoint
Retrieves all SQL Server endpoints including DatabaseMirroring, ServiceBroker, Soap, and TSql types with their network configuration details. This function provides essential information for …
Get-DbaErrorLog
Retrieves entries from SQL Server error logs across all available log files (0-99, where 0 is current and 99 is oldest). Essential for troubleshooting SQL Server issues, monitoring login failures, …
Get-DbaErrorLogConfig
Retrieves current error log configuration from SQL Server instances, showing how many log files are retained, where they're stored, and size limits if configured. This information helps DBAs …
Get-DbaEstimatedCompletionTime
Retrieves real-time progress information for long-running SQL Server maintenance and administrative operations by querying sys.dm_exec_requests. This function helps DBAs monitor the status of …
Get-DbaExecutionPlan
Retrieves execution plans from SQL Server's plan cache using Dynamic Management Views (sys.dm_exec_query_stats, sys.dm_exec_query_plan, and sys.dm_exec_text_query_plan). This is essential for …
Get-DbaExtendedProperty
Retrieves extended properties that contain custom metadata, documentation, and business descriptions attached to SQL Server objects. Extended properties are commonly used by DBAs and developers to …
Get-DbaExtendedProtection
Retrieves the Extended Protection setting for SQL Server instances to help assess authentication security posture. Extended Protection is a Windows authentication enhancement that helps prevent …
Get-DbaExternalProcess
Identifies and returns all child processes created by SQL Server, such as those spawned by xp_cmdshell, BCP operations, SSIS packages, or other external utilities. This is particularly useful when …
Get-DbaFeature
Executes SQL Server's built-in feature discovery report to inventory all installed SQL Server components, editions, and instances across one or more servers. This function automates the manual process …
Get-DbaFile
Searches directories on SQL Server machines remotely without requiring direct file system access or RDP connections. Uses the xp_dirtree extended stored procedure to return file listings that can be …
Get-DbaFilestream
Retrieves FileStream configuration status by checking both the SQL Server service configuration and the instance-level sp_configure settings. This function helps DBAs quickly identify FileStream …
Get-DbaFirewallRule
Retrieves Windows firewall rules for SQL Server components from target computers, helping DBAs troubleshoot connectivity issues and audit network security configurations. This command queries firewall …
Get-DbaForceNetworkEncryption
Retrieves the Force Network Encryption setting and associated certificate from SQL Server's network configuration stored in the Windows registry. This setting determines whether SQL Server requires …
Get-DbaHelpIndex
This function queries SQL Server DMVs to return detailed index and statistics information for performance analysis, index maintenance planning, and identifying optimization opportunities. You can …
Get-DbaHideInstance
Retrieves the Hide Instance setting from the Windows registry for SQL Server instances. This security setting controls whether the instance appears when clients browse the network for available SQL …
Get-DbaInstalledPatch
Queries the Windows Registry to retrieve a complete history of SQL Server patches installed on one or more computers. This includes Cumulative Updates (CUs), Service Packs, and Hotfixes that have been …
Get-DbaInstanceAudit
Retrieves all configured SQL Server audit objects at the instance level, which define where security audit events are stored and how they're managed. These audits capture login attempts, permission …
Get-DbaInstanceAuditSpecification
Returns all server-level audit specifications configured on SQL Server instances, including their enabled status, associated audit names, and configuration details. This helps DBAs inventory audit …
Get-DbaInstanceInstallDate
Queries system tables (sys.server_principals or sysservers) to determine when SQL Server was originally installed on each target instance. This information is essential for compliance auditing, …
Get-DbaInstanceList
Returns all SQL Server instance names from the user-maintained list that is pre-loaded into the dbatools tab completion cache for the -SqlInstance parameter. This list allows users to have their …
Get-DbaInstanceProperty
Retrieves all instance-level configuration properties from SQL Server's Information, UserOptions, and Settings collections via SMO. This gives you a complete inventory of server settings like default …
Get-DbaInstanceProtocol
Retrieves the configuration and status of SQL Server network protocols (TCP/IP, Named Pipes, Shared Memory, VIA) by querying the WMI ComputerManagement namespace. This is essential for troubleshooting …
Get-DbaInstanceTrigger
Returns server-level DDL triggers that monitor and respond to instance-wide events like CREATE, ALTER, and DROP statements. Server triggers are commonly used for security auditing, change tracking, …
Get-DbaInstanceUserOption
Returns the default user options configured at the SQL Server instance level that are automatically applied to new database connections. These settings include ANSI compliance options like ANSI_NULLS, …
Get-DbaIoLatency
Queries sys.dm_io_virtual_file_stats to collect detailed I/O performance statistics for every database file on the SQL Server instance. Returns calculated latency metrics including read latency, write …
Get-DbaKbUpdate
Searches Microsoft's update catalog website to retrieve comprehensive information about KB updates including service packs, hotfixes, and cumulative updates. Returns detailed metadata such as …
Get-DbaLastBackup
Queries msdb backup history to retrieve the most recent full, differential, and transaction log backup dates for each database. This function helps DBAs quickly identify backup gaps and verify …
Get-DbaLastGoodCheckDb
Retrieves and compares the timestamp for the last successful DBCC CHECKDB operation along with database creation dates. This helps DBAs monitor database integrity checking compliance and identify …
Get-DbaLatchStatistic
Analyzes latch wait statistics from sys.dm_os_latch_stats to help identify latch contention issues that may be causing performance problems. This function implements Paul Randal's methodology for …
Get-DbaLinkedServer
Pulls complete linked server information from one or more SQL Server instances, including remote server names, authentication methods, and security settings. This helps DBAs audit cross-server …
Get-DbaLinkedServerLogin
Retrieves the login mappings configured for linked servers, showing how local SQL Server logins are mapped to remote server credentials. This function returns details about each login mapping …
Get-DbaLocaleSetting
Retrieves Windows locale settings from the Control Panel\International registry key on one or more computers. These settings directly impact SQL Server's date/time formatting, currency display, number …
Get-DbaLogin
⭐Returns detailed information about SQL Server login accounts, including authentication type, security status, and last login times. This function helps DBAs perform security audits by identifying …
Get-DbaMaintenanceSolutionLog
Retrieves detailed execution information from IndexOptimize text log files when LogToTable='N' is configured in Ola Hallengren's MaintenanceSolution. This function parses the text files written to the …
Get-DbaManagementObject
Scans the system for SQL Server Management Object (SMO) assemblies, SqlClient libraries, and SNI modules to help troubleshoot version conflicts and connectivity issues. This function checks both the …
Get-DbaMaxMemory
This command retrieves the SQL Server 'Max Server Memory' configuration setting alongside the total physical memory installed on the server. This comparison helps identify potential memory …
Get-DbaMemoryCondition
Analyzes SQL Server's internal resource monitor ring buffers to identify memory pressure events and track memory utilization over time. This helps DBAs diagnose performance issues caused by …
Get-DbaMemoryUsage
Collects detailed memory usage from SQL Server Database Engine, Analysis Services (SSAS), and Integration Services (SSIS) using Windows performance counters. This helps you troubleshoot memory …
Get-DbaModule
Queries sys.sql_modules and sys.objects to find database modules that have been modified within a specified timeframe, helping DBAs track recent code changes for troubleshooting, auditing, or …
Get-DbaMsdtc
Returns comprehensive MSDTC information including service state, security settings, and component identifiers (CIDs) from target servers. MSDTC is essential for SQL Server distributed transactions, …
Get-DbaNetworkActivity
Retrieves current network activity metrics including bytes received, sent, and total throughput per second for every network interface on target computers. This function helps DBAs monitor network …
Get-DbaNetworkCertificate
Retrieves the specific computer certificate that SQL Server is configured to use for network encryption and SSL connections. This shows you which certificate from the local certificate store is …
Get-DbaNetworkConfiguration
Collects comprehensive network configuration details for SQL Server instances, providing the same information visible in SQL Server Configuration Manager but in a scriptable PowerShell format. This …
Get-DbaNetworkEncryption
Connects directly to a SQL Server instance's TCP port and retrieves the TLS/SSL certificate that the server presents during the TLS handshake. This does not require Windows host access or WinRM - it …
Get-DbaOleDbProvider
Returns the OLE DB providers that SQL Server knows about and can use for external data connections like linked servers, distributed queries, and OPENROWSET operations. This is essential for auditing …
Get-DbaOpenTransaction
Queries SQL Server dynamic management views to identify open transactions that may be causing blocking, consuming transaction log space, or impacting performance. Returns comprehensive details …
Get-DbaOperatingSystem
Collects detailed operating system information from local or remote Windows computers hosting SQL Server instances. Returns comprehensive system details including OS version, memory configuration, …
Get-DbaPageFileSetting
This command uses CIM to retrieve detailed Windows page file configuration from SQL Server host computers. Page file settings directly impact SQL Server performance during memory pressure scenarios, …
Get-DbaPbmCategory
Retrieves all policy categories configured in SQL Server's Policy-Based Management (PBM) feature. Policy categories help organize and group related policies for easier management and selective …
Get-DbaPbmCategorySubscription
Retrieves all database subscriptions to policy categories from SQL Server's Policy-Based Management feature. These subscriptions determine which databases are subject to automatic policy evaluation …
Get-DbaPbmCondition
Retrieves Policy-Based Management (PBM) conditions from SQL Server instances, which define the rules and criteria used to evaluate database objects for compliance. These conditions form the building …
Get-DbaPbmObjectSet
Retrieves object sets from SQL Server's Policy-Based Management (PBM) feature, which define collections of SQL Server objects that policies can target for compliance monitoring. Object sets group …
Get-DbaPbmPolicy
Retrieves all Policy-Based Management policies configured on SQL Server instances, allowing DBAs to audit compliance configurations and review policy settings across their environment. This function …
Get-DbaPbmStore
Retrieves the Policy-Based Management (PBM) store object, which serves as the foundation for managing SQL Server policies, conditions, and categories. This store object is required for accessing and …
Get-DbaPermission
⭐Retrieves comprehensive permission information from SQL Server instances and databases, including both explicit permissions and implicit permissions from fixed roles. This function queries …
Get-DbaPfAvailableCounter
Retrieves all Windows performance counters available on specified machines by reading directly from the registry for fast enumeration. This is essential when setting up SQL Server monitoring because …
Get-DbaPfDataCollector
Retrieves detailed information about Windows Performance Monitor data collectors within collector sets, commonly used by DBAs to monitor SQL Server performance counters. This function parses the XML …
Get-DbaPfDataCollectorCounter
Retrieves the list of performance counters that are configured within Windows Performance Monitor Data Collector Sets. This is useful for auditing performance monitoring configurations, verifying …
Get-DbaPfDataCollectorCounterSample
Collects performance counter data from Windows Performance Monitor collector sets and individual counters on SQL Server systems. This function wraps PowerShell's Get-Counter cmdlet to provide …
Get-DbaPfDataCollectorSet
Retrieves detailed information about Windows Performance Monitor Data Collector Sets, which are used to collect performance counters for SQL Server monitoring and troubleshooting. Data Collector Sets …
Get-DbaPfDataCollectorSetTemplate
Retrieves information about predefined Windows Performance Monitor (PerfMon) templates specifically created for SQL Server performance analysis. These templates include counter sets for monitoring …
Get-DbaPlanCache
Analyzes the plan cache to identify memory consumed by single-use adhoc and prepared statements that are unlikely to be reused. These plans accumulate over time and can consume significant memory …
Get-DbaPowerPlan
Checks the active Windows Power Plan configuration on SQL Server host computers to ensure they follow performance best practices. SQL Server performance can be significantly impacted by power …
Get-DbaPrivilege
Audits six Windows privileges that directly impact SQL Server performance and functionality: Lock Pages in Memory, Instant File Initialization, Logon as Batch, Generate Security Audits, Logon as a …
Get-DbaProcess
Displays comprehensive information about SQL Server processes including session details, connection properties, timing data, and the last executed SQL statement. This function combines data from …
Get-DbaProductKey
⭐Decodes SQL Server product keys from registry DigitalProductID entries across all installed instances on target computers. This is essential for license compliance auditing, asset inventory during …
Get-DbaQueryExecutionTime
Analyzes SQL Server's query execution statistics to identify performance bottlenecks by examining CPU worker time data from dynamic management views. This function queries sys.dm_exec_procedure_stats …
Get-DbaRandomizedDataset
Generates random test datasets using JSON templates that define column names and data types. This function creates realistic sample data for database development, testing, and training environments …
Get-DbaRandomizedDatasetTemplate
Retrieves JSON template files from default and custom directories that define how to generate realistic test datasets. These templates specify column names, data types, and semantic subtypes (like …
Get-DbaRandomizedType
Returns all available randomizer types and subtypes that can be used with Get-DbaRandomizedValue for data masking and test data generation. These types include realistic data patterns like Person …
Get-DbaRandomizedValue
Creates realistic fake data by generating random values that match SQL Server data type constraints or using specialized data patterns like names, addresses, and phone numbers. This function is …
Get-DbaRegistryRoot
Queries SQL Server WMI to locate the exact Windows registry hive path where each SQL Server instance stores its configuration settings. This eliminates the guesswork when you need to manually edit …
Get-DbaRegServer
Retrieves SQL Server instances from registered server configurations stored in SQL Server Management Studio (SSMS), Azure Data Studio, and Central Management Server (CMS). DBAs use registered servers …
Get-DbaRegServerGroup
Returns server group objects from Central Management Server, which are organizational containers that help DBAs manage multiple SQL Server instances in a hierarchical structure. Server groups allow …
Get-DbaRegServerStore
Creates a RegisteredServersStore object that serves as the foundation for working with SQL Server Central Management Server (CMS). This object provides access to server groups and registered servers …
Get-DbaReplArticle
Retrieves comprehensive details about articles within SQL Server replication publications, helping DBAs audit and manage replication topology. Articles define which tables, views, or stored procedures …
Get-DbaReplArticleColumn
Returns detailed information about which columns are included in replication articles, helping DBAs audit replication configurations and troubleshoot column-specific replication issues. This is …
Get-DbaReplDistributor
Connects to SQL Server instances and retrieves detailed information about their replication distributor configuration, including distributor status, distribution database details, and publisher …
Get-DbaReplPublication
Scans SQL Server instances to identify and return all replication publications configured as publishers. This function examines each database's replication options to locate published databases, then …
Get-DbaReplPublisher
Retrieves detailed information about SQL Server replication publishers configured on distribution servers. This function connects to instances acting as distributors and returns publisher details …
Get-DbaReplServer
Returns a ReplicationServer object that shows whether each SQL Server instance is configured as a distributor, publisher, or both in the replication topology. This helps DBAs quickly identify server …
Get-DbaReplSubscription
Retrieves detailed information about replication subscriptions, showing which subscriber instances are receiving data from publications. This is essential for monitoring replication topology, …
Get-DbaResourceGovernor
Retrieves the Resource Governor object containing configuration details, enabled status, and associated resource pools. Resource Governor allows DBAs to manage SQL Server workload and resource …
Get-DbaRgClassifierFunction
Retrieves the custom classifier function that Resource Governor uses to determine which workload group incoming connections are assigned to. The classifier function contains the business logic that …
Get-DbaRgResourcePool
Retrieves detailed information about SQL Server Resource Governor resource pools, including both internal (CPU/memory) and external (R/Python) pools. Shows current configuration settings for minimum …
Get-DbaRgWorkloadGroup
Retrieves Resource Governor workload groups along with their configuration settings including CPU limits, memory grants, and parallelism controls. Workload groups define how resource requests are …
Get-DbaRunningJob
This function returns SQL Server Agent jobs that are actively running at the moment you call it, filtering out any jobs in idle state. Use this to monitor job execution during maintenance windows, …
Get-DbaSchemaChangeHistory
Queries the default system trace to track CREATE, DROP, and ALTER operations performed on database objects, providing a complete audit trail of schema modifications. This helps DBAs identify who made …
Get-DbaServerRole
Retrieves all server-level security roles from SQL Server instances, including role members, creation dates, and ownership details. This function helps DBAs audit server-level permissions, identify …
Get-DbaServerRoleMember
Returns detailed information about which logins are members of server-level roles like sysadmin, dbcreator, and securityadmin. Essential for security audits, compliance reviews, and troubleshooting …
Get-DbaService
⭐Retrieves detailed information about SQL Server-related Windows services across one or more computers, including Database Engine, SQL Agent, Reporting Services, Analysis Services, Integration …
Get-DbaSpConfigure
Retrieves all SQL Server instance-level configuration settings accessible through sp_configure, using SMO to gather comprehensive details about each setting. This function compares current configured …
Get-DbaSpinLockStatistic
Queries sys.dm_os_spinlock_stats to return detailed statistics about SQL Server's spinlock usage and contention. Spinlocks are lightweight synchronization primitives that SQL Server uses internally …
Get-DbaSpn
Queries Active Directory to return SPNs that are currently registered for SQL Server services on specified computers or service accounts. This is essential for troubleshooting Kerberos authentication …
Get-DbaSsisEnvironmentVariable
Retrieves all variables from specified SSIS environments stored in the SSISDB catalog database. All sensitive values are automatically decrypted and returned in plaintext for configuration management …
Get-DbaSsisExecutionHistory
Retrieves detailed execution history for SSIS packages from the SSIS catalog database, including execution status, timing, and environment details. This function queries the catalog.executions view in …
Get-DbaStartupParameter
Extracts and parses SQL Server startup parameters directly from the Windows service configuration using WMI. Returns detailed information about file paths (master database, transaction log, error …
Get-DbaStartupProcedure
This function returns stored procedures from the master database that are configured to execute automatically during SQL Server startup. Startup procedures are useful for initializing application …
Get-DbaSuspectPage
Queries the msdb.dbo.suspect_pages table to identify database pages that have experienced corruption events such as checksum failures, torn pages, or I/O errors. SQL Server automatically logs corrupt …
Get-DbaTcpPort
By default, this function returns just the TCP port used by the specified SQL Server. If -All is specified, the server name, IPAddress (ipv4 and ipv6), port number and an indicator of whether or not …
Get-DbaTempdbUsage
This function queries DMVs for running sessions using tempdb and returns results if those sessions have user or internal space allocated or deallocated against them.
Get-DbatoolsChangeLog
Launches your default browser to view the dbatools release changelog on GitHub. This provides access to version history, new features, bug fixes, and breaking changes for the dbatools PowerShell …
Get-DbatoolsConfig
Retrieves dbatools module configuration settings that control how dbatools functions behave. These settings include connection timeouts, default paths, email configurations, and other module …
Get-DbatoolsConfigValue
Retrieves the actual value stored in a specific dbatools configuration setting using its full name (Module.Name format). This function is primarily used internally by dbatools functions to access …
Get-DbatoolsError
Retrieves detailed error information specifically from dbatools command failures, filtering the PowerShell error collection to show only dbatools-related errors. This provides comprehensive diagnostic …
Get-DbatoolsLog
Retrieves log entries from dbatools' internal logging system, allowing you to troubleshoot command execution and track what happened during script runs. Use this when dbatools commands aren't behaving …
Get-DbatoolsPath
Retrieves file paths that have been configured for use by dbatools functions. These paths define where the module stores temporary files, exports, logs, and other data during SQL Server operations. …
Get-DbaTopResourceUsage
Analyzes cached query performance by examining sys.dm_exec_query_stats to find your worst-performing queries across four key metrics: total duration, execution frequency, IO operations, and CPU time. …
Get-DbaTrace
Queries the sys.traces system view to return detailed information about active and configured traces on a SQL Server instance. This includes trace status, file locations, buffer settings, event …
Get-DbaTraceFlag
Queries SQL Server instances to identify which global trace flags are currently active, returning detailed status information for monitoring and compliance purposes. This is essential for auditing …
Get-DbaUptime
This function determines SQL Server uptime by checking the tempdb creation date and calculates Windows server uptime using CIM/WMI calls to get the last boot time. Essential for monitoring system …
Get-DbaUserPermission
⭐Performs a comprehensive security audit by analyzing all server logins, server-level permissions, database users, database roles, and object-level permissions across SQL Server instances. Creates …
Get-DbaWaitingTask
Queries sys.dm_os_waiting_tasks and related DMVs to identify sessions that are currently waiting, along with comprehensive diagnostic information including wait types, durations, blocking sessions, …
Get-DbaWaitResource
Converts cryptic wait resource identifiers from sys.dm_exec_requests into readable database object details that DBAs can actually use for troubleshooting. When you're investigating blocking chains or …
Get-DbaWaitStatistic
Analyzes SQL Server wait statistics from sys.dm_os_wait_stats to identify performance bottlenecks and resource contention issues. This function categorizes wait types, calculates timing metrics and …
Get-DbaWindowsLog
Parses SQL Server error log files directly from the file system to extract structured error information including timestamps, SPIDs, error numbers, severity levels, and messages. Locates error log …
Get-DbaWsfcAvailableDisk
Identifies shared storage disks that are visible to all cluster nodes and eligible for clustering, but have not yet been added to the cluster's storage pool. This is essential when planning to expand …
Get-DbaWsfcCluster
Retrieves detailed configuration and operational status information from Windows Server Failover Clusters that host SQL Server instances. This function connects to cluster nodes or the cluster name …
Get-DbaWsfcDisk
Retrieves comprehensive disk information from Windows Server Failover Clusters including disk space usage, file systems, mount points, and cluster resource states. This function is essential for DBAs …
Get-DbaWsfcNetwork
Retrieves detailed network information from Windows Server Failover Cluster nodes, including IP addresses, subnet masks, and network roles. This information is essential for diagnosing connectivity …
Get-DbaWsfcNetworkInterface
Retrieves detailed network adapter information from all nodes in a Windows Server Failover Cluster, including IP addresses, DHCP settings, and network assignments. This information is essential for …
Get-DbaWsfcNode
Retrieves configuration and status details for individual nodes (servers) within Windows Server Failover Clusters that host SQL Server FCIs or Availability Groups. This function connects to cluster …
Get-DbaWsfcResource
Retrieves comprehensive information about cluster resources including SQL Server instances, disks, network names, and other services managed by the failover cluster. Shows current state, ownership, …
Get-DbaWsfcResourceGroup
Retrieves detailed information about Windows Server Failover Cluster resource groups, including their current state, persistent state, and which node currently owns them. This function helps DBAs …
Get-DbaWsfcResourceType
Retrieves detailed information about all resource types available in a Windows Server Failover Cluster. Resource types define what kinds of cluster resources can be created, including SQL Server …
Get-DbaWsfcRole
Retrieves detailed information about Windows Server Failover Cluster roles (resource groups), including their current state, and which node currently owns them. This function helps DBAs monitor and …
Get-DbaWsfcSharedVolume
Retrieves detailed configuration and operational information about Cluster Shared Volumes (CSVs) from Windows Server Failover Clusters. CSVs provide the shared storage foundation for SQL Server …
Get-DbaXEObject
This function queries sys.dm_xe_packages and sys.dm_xe_objects to discover what Extended Events components are available on your SQL Server instances. Use this when planning Extended Events sessions …
Get-DbaXESession
This function connects to one or more SQL Server instances and returns comprehensive information about Extended Events sessions, including their current status, configuration details, target files, …
Get-DbaXESessionTarget
Returns detailed information about Extended Events session targets including their properties, file paths, and current status. This function helps DBAs examine where Extended Events data is being …
Get-DbaXESessionTargetFile
Returns file system objects for Extended Events session target files, allowing you to examine the actual XE log files created by file-based targets. This function locates and lists the physical .xel …
Get-DbaXESessionTemplate
Retrieves metadata from Extended Event session templates stored in XML format, showing you what pre-built Extended Event sessions are available before importing them to your SQL Server instances. This …
Get-DbaXEStore
Retrieves the Extended Events store object from SQL Server instances, which serves as the foundation for working with Extended Events sessions, packages, and configurations. The store object provides …
Grant-DbaAgPermission
Grants permissions to SQL Server logins for availability groups (Alter, Control, TakeOwnership, ViewDefinition) and database mirroring endpoints (Connect, Alter, Control, and others). Essential for …
Import-Command
Import-DbaBinaryFile
Reads binary files from disk and stores them in SQL Server tables with binary, varbinary, or image columns. This is useful for storing documents, images, executables, or any file type directly in the …
Import-DbaCsv
⭐Import-DbaCsv uses .NET's SqlBulkCopy class to efficiently load CSV data into SQL Server tables, handling files of any size from small datasets to multi-gigabyte imports. The function wraps the entire …
Import-DbaParquet
Import-DbaParquet uses .NET's SqlBulkCopy class to efficiently load Parquet data into SQL Server tables, handling files of any size from small datasets to multi-gigabyte imports. The function wraps …
Import-DbaPfDataCollectorSetTemplate
Creates Windows Performance Monitor data collector sets using XML templates containing SQL Server performance counters. This eliminates the need to manually configure dozens of performance counters …
Import-DbaRegServer
Imports registered servers and server groups into a SQL Server Central Management Server (CMS) from multiple sources including exported XML files, other CMS instances, or custom objects like CSVs. The …
Import-DbaSpConfigure
Copies all sp_configure settings from a source SQL Server instance to a destination instance, or applies sp_configure settings from a SQL file to an instance. This function handles advanced options …
Import-DbatoolsConfig
Loads dbatools configuration settings from JSON files or retrieves module-specific settings from default configuration locations. This lets you restore saved dbatools preferences, share standardized …
Import-DbaXESessionTemplate
Creates new Extended Events sessions using predefined XML templates from the dbatools repository or custom template files you specify. This function simplifies XE session deployment by providing …
Install-DbaAgentAdminAlert
Creates a predefined set of SQL Server Agent alerts that monitor for critical system errors (severity levels 17-25) and disk I/O corruption errors (messages 823-825). These alerts catch serious issues …
Install-DbaDarlingData
Downloads, extracts and installs Erik Darling's collection of performance monitoring stored procedures from the DarlingData GitHub repository. This gives you access to popular diagnostic tools like …
Install-DbaFirstResponderKit
Downloads and installs the First Responder Kit (FRK), a collection of stored procedures designed for SQL Server health checks, performance analysis, and troubleshooting. The FRK includes essential …
Install-DbaInstance
⭐Orchestrates unattended SQL Server installations by generating configuration files and executing setup.exe remotely or locally. Automates the tedious process of creating proper configuration.ini …
Install-DbaMaintenanceSolution
⭐Deploys Ola Hallengren's comprehensive maintenance framework including DatabaseBackup, DatabaseIntegrityCheck, IndexOptimize, and CommandExecute stored procedures to automate backup, DBCC checks, and …
Install-DbaMultiTool
Downloads and installs the DBA MultiTool collection of T-SQL stored procedures into a specified database. This toolkit provides five key utilities that help DBAs with common documentation and …
Install-DbaParquet
Downloads Parquet.NET from NuGet and installs the netstandard2.0 assemblies into the dbatools data directory. The installer also downloads and extracts the managed dependency closure declared by the …
Install-DbaSqlPackage
Downloads and installs Microsoft SqlPackage utility, which is essential for database deployment automation and DACPAC operations. This prerequisite tool enables you to use Import-DbaDacpac, …
Install-DbaSqlWatch
⭐Deploys SqlWatch, an open-source SQL Server monitoring and performance collection tool, to one or more SQL Server instances. SqlWatch continuously gathers performance metrics, wait statistics, and …
Install-DbaWhoIsActive
Installs Adam Machanic's sp_WhoIsActive stored procedure, the most widely-used tool for monitoring active SQL Server sessions in real-time. This procedure provides detailed information about currently …
Invoke-DbaAdvancedInstall
Performs the complete SQL Server installation workflow on a target computer, including pre and post-installation restart management. This internal function handles copying configuration files to …
Invoke-DbaAdvancedRestore
This is the final execution step in the dbatools restore pipeline. It takes pre-processed BackupHistory objects and performs the actual SQL Server database restoration with support for complex …
Invoke-DbaAdvancedUpdate
Executes SQL Server KB updates on a target computer by extracting patch files, running setup.exe with appropriate parameters, and managing system restarts as needed. This function handles the core …
Invoke-DbaAgFailover
Performs manual failover of an availability group to make the specified SQL Server instance the new primary replica. The function connects to the target instance (which must be a secondary replica) …
Invoke-DbaBalanceDataFiles
When you have a large database with a single data file and add another file, SQL Server will only use the new file until it's about the same size. You may want to balance the data between all the data …
Invoke-DbaCycleErrorLog
Archives the current error log files and creates new ones for SQL Server instance and/or SQL Agent. This operation is typically performed during maintenance windows to manage log file sizes and …
Invoke-DbaDbAzSqlTip
Executes Microsoft's Azure SQL Tips script against Azure SQL Database instances to identify performance optimization opportunities and design recommendations. This function runs the get-sqldb-tips.sql …
Invoke-DbaDbccDropCleanBuffer
Executes DBCC DROPCLEANBUFFERS to remove all clean data pages from the buffer pool and columnstore objects from memory. This forces SQL Server to read data from disk on subsequent queries, simulating …
Invoke-DbaDbccFreeCache
Executes DBCC commands to clear various SQL Server memory caches when troubleshooting performance problems or freeing memory on resource-constrained systems. This function helps DBAs resolve issues …
Invoke-DbaDbClone
Creates schema-only database clones using SQL Server's DBCC CLONEDATABASE command. The cloned database contains all database objects (tables, indexes, views, procedures) and statistics, but no actual …
Invoke-DbaDbDataGenerator
Populates database tables with randomly generated but realistic test data based on JSON configuration files. Uses the Bogus library to create fake but believable data like names, addresses, phone …
Invoke-DbaDbDataMasking
Replaces sensitive data in SQL Server databases with randomized values based on a JSON configuration file. This enables DBAs to create safe, non-production datasets for development, testing, and …
Invoke-DbaDbDbccCheckConstraint
Executes DBCC CHECKCONSTRAINTS to identify rows that violate CHECK, FOREIGN KEY, and other constraints in your databases. This command helps DBAs verify data integrity after bulk imports, constraint …
Invoke-DbaDbDbccCleanTable
Executes DBCC CLEANTABLE to reclaim disk space after variable-length columns (varchar, nvarchar, varbinary, text, ntext, image, xml, or CLR user-defined types) have been dropped from tables or indexed …
Invoke-DbaDbDbccUpdateUsage
Executes the DBCC UPDATEUSAGE command to identify and fix metadata inconsistencies in catalog views that track space usage information. When these internal counters become inaccurate, system …
Invoke-DbaDbDecryptObject
Recovers the original source code from encrypted database objects when the original scripts have been lost or are unavailable. This command uses the Dedicated Admin Connection (DAC) to access binary …
Invoke-DbaDbLogShipping
Invoke-DbaDbLogShipping helps to easily set up log shipping for one or more databases. This function will make a lot of decisions for you assuming you want default values like a daily interval for the …
Invoke-DbaDbLogShipRecovery
Recovers log shipped secondary databases from standby or restoring state to normal operational state. This function is essential for disaster recovery scenarios when you need to bring secondary …
Invoke-DbaDbMirrorFailover
Performs a database mirroring failover by switching roles between the primary and mirror servers. For synchronous mirroring, sets safety level to Full and executes a clean failover without data loss. …
Invoke-DbaDbMirroring
Creates database mirroring configurations between SQL Server instances, handling the complete end-to-end setup process that would normally require dozens of manual T-SQL commands and careful …
Invoke-DbaDbPiiScan
This command will go through the tables in your database and assess each column. It will first check the columns names if it was named in such a way that it would indicate PII. The next thing that it …
Invoke-DbaDbShrink
Reduces database file sizes by removing unused space from data files, log files, or both. This function targets specific files within databases and can reclaim substantial disk space when databases …
Invoke-DbaDbTransfer
Transfers database objects and data between SQL Server instances or databases by executing an SMO Transfer object. This function handles database migrations, environment synchronization, and selective …
Invoke-DbaDbUpgrade
Performs the essential steps needed after upgrading SQL Server or moving databases to a newer instance. Updates database compatibility level to match the hosting SQL Server version and sets target …
Invoke-DbaDiagnosticQuery
Runs Glenn Berry's comprehensive collection of DMV-based diagnostic queries to analyze SQL Server performance, configuration, and health issues. These queries help identify common problems like …
Invoke-DbaPfRelog
Pipeline-compatible wrapper for the relog command. Relog is useful for converting Windows Perfmon. Extracts performance counters from performance counter logs into other formats, such as text-TSV (for …
Invoke-DbaQuery
⭐Executes T-SQL commands against one or more SQL Server instances, supporting queries from strings, files, URLs, or SQL Server Management Objects. This is the primary dbatools command for running …
Invoke-DbatoolsFormatter
Applies consistent code formatting to PowerShell files using PSScriptAnalyzer's Invoke-Formatter with OTBS (One True Brace Style) settings. This function standardizes indentation, brace placement, and …
Invoke-DbatoolsRenameHelper
Automatically scans and updates PowerShell script files to replace old dbatools command names and parameter names that have been renamed over time. This function searches through your scripts for over …
Invoke-DbaWhoIsActive
Executes Adam Machanic's sp_WhoIsActive stored procedure to display detailed information about currently running sessions, active queries, and their resource consumption. This is the go-to command for …
Invoke-DbaXEReplay
This command replays SQL workloads captured in Extended Event files against one or more target SQL Server instances for performance testing and load simulation. It extracts SQL statements from …
Join-DbaAvailabilityGroup
Adds a SQL Server instance as a secondary replica to an existing availability group that has already been created on the primary replica. This command is typically used after creating the availability …
Join-DbaPath
Constructs file paths by joining multiple segments while automatically using the correct path separators (backslash for Windows, forward slash for Linux) based on the target SQL Server instance's …
Measure-DbaBackupThroughput
Analyzes backup history records from the msdb database to calculate detailed throughput statistics including average, minimum, and maximum backup speeds measured in megabytes per second. This function …
Measure-DbaDbVirtualLogFile
Analyzes Virtual Log File (VLF) fragmentation across databases by counting total, active, and inactive VLFs in transaction logs. This function helps identify databases with excessive VLF counts that …
Measure-DbaDiskSpaceRequirement
Analyzes database files on source and destination instances to calculate space requirements before migration. Shows file size differences, mount points, and identifies potential overwrites when …
Measure-DbatoolsImport
Returns performance data collected during the dbatools module import process, showing the duration of each import step. This function helps troubleshoot slow module loading times by identifying which …
Mount-DbaDatabase
Attaches detached database files (.mdf, .ldf, .ndf) back to a SQL Server instance, making the database available for use again. When database files exist on disk but the database is not registered in …
Move-DbaDbFile
Relocates database data and log files to new locations on the same SQL Server instance. The function takes the database offline, copies files to the new location, updates the database metadata with …
Move-DbaRegServer
Moves registered server entries from one group to another within Central Management Server hierarchy. This helps reorganize CMS structure when server roles change or you need to restructure your …
Move-DbaRegServerGroup
Moves registered server groups to new locations within your Central Management Server hierarchy. This lets you reorganize your CMS group structure without using SQL Server Management Studio manually. …
New-DbaAgentAlert
Creates new SQL Server Agent alerts that monitor for specific error severities, message IDs, performance conditions, or WMI events. Alerts can automatically notify operators via email, pager, or net …
New-DbaAgentAlertCategory
Creates custom alert categories in SQL Server Agent to help organize and group related alerts for better management and monitoring. Alert categories allow DBAs to logically group alerts by function, …
New-DbaAgentJob
Creates SQL Server Agent jobs with full configuration options including owner assignment, job categories, and comprehensive notification settings. You can configure email, event log, pager, and …
New-DbaAgentJobCategory
Creates custom job categories in SQL Server Agent to help organize and classify jobs by function, department, or priority level. Job categories provide a way to group related jobs together for easier …
New-DbaAgentJobStep
Creates individual job steps within SQL Server Agent jobs, allowing you to build complex automation workflows without manually configuring each step through SSMS. Each step can execute different types …
New-DbaAgentOperator
Creates SQL Server Agent operators who receive notifications when alerts fire or jobs fail. Operators are contacts that SQL Server Agent can notify via email, pager, or net send when specific events …
New-DbaAgentProxy
Creates SQL Server Agent proxy accounts that allow job steps to execute under different security contexts than the SQL Agent service account. Proxy accounts use existing SQL Server credentials and can …
New-DbaAgentSchedule
Creates a new schedule in the msdb database that defines when SQL Server Agent jobs should execute. Schedules can be created as standalone objects or immediately attached to existing jobs, allowing …
New-DbaAvailabilityGroup
Creates availability groups with full automation, eliminating the manual multi-step process typically required through T-SQL or SSMS. This command handles the entire workflow from initial validation …
New-DbaAzAccessToken
Creates OAuth2 access tokens for connecting to Azure SQL Database and other Azure services without storing passwords in scripts. Supports Managed Identity authentication from Azure VMs, Service …
New-DbaClientAlias
Creates or updates SQL Server client aliases by modifying registry keys in HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo, replacing the need for manual cliconfg.exe configuration. This allows …
New-DbaCmConnection
Creates connection objects that optimize remote computer management for SQL Server environments using CIM and WMI protocols. These objects cache successful authentication methods and connection …
New-DbaComputerCertificate
Creates a new computer certificate - self-signed or signed by an Active Directory CA, using the Web Server certificate. By default, a key with a length of 2048 bits and a friendly name of "SQL Server" …
New-DbaComputerCertificateSigningRequest
Creates certificate signing requests (CSRs) that can be submitted to your Certificate Authority to obtain SSL/TLS certificates for SQL Server instances. This eliminates the manual process of creating …
New-DbaConnectionString
⭐Creates properly formatted SQL Server connection strings without having to manually construct complex connection string syntax. Instead of remembering obscure keywords like "Data Source" or "Initial …
New-DbaConnectionStringBuilder
Creates a Microsoft.Data.SqlClient.SqlConnectionStringBuilder object from either an existing connection string or individual connection parameters. This allows you to programmatically build, modify, …
New-DbaCredential
Creates a SQL Server credential that stores authentication information for connecting to external resources like Azure storage accounts, network shares, or service accounts. Credentials are commonly …
New-DbaCustomError
Creates custom error messages in SQL Server's sys.messages table using sp_addmessage, enabling standardized error handling across applications and stored procedures. This replaces the need to manually …
New-DbaDacOption
Creates a new Microsoft.SqlServer.Dac.DacExtractOptions/DacExportOptions object that can be used during DacPackage extract. Basically saves you the time from remembering the SMO assembly name ;) See: …
New-DbaDacPackage
Creates a DACPAC (Data-tier Application Package) from SQL source files without requiring MSBuild, Visual Studio, or the .NET SDK. Uses the Microsoft.SqlServer.Dac.Model.TSqlModel API to parse SQL …
New-DbaDacProfile
The New-DbaDacProfile command generates standard publish profile XML files that control how DacFx deploys your dacpac files to SQL Server databases. These profile files define deployment settings like …
New-DbaDatabase
Creates new databases on SQL Server instances with full control over file placement, sizing, and growth settings. Rather than using T-SQL CREATE DATABASE statements manually, this function provides a …
New-DbaDbAsymmetricKey
Creates asymmetric keys within SQL Server databases using RSA encryption algorithms (512-4096 bit). These keys are essential for database-level encryption features like Transparent Data Encryption …
New-DbaDbCertificate
Creates a new database certificate within a specified database using SQL Server Management Objects. Database certificates are essential for implementing Transparent Data Encryption (TDE), encrypting …
New-DbaDbDataGeneratorConfig
Analyzes database table structures and generates JSON configuration files that define how to populate each column with realistic fake data. The function examines column names, data types, constraints, …
New-DbaDbEncryptionKey
Creates database encryption keys (DEKs) required for Transparent Data Encryption, using certificates or asymmetric keys from the master database. This is the essential first step before enabling TDE …
New-DbaDbFileGroup
Creates a new filegroup for the specified database(s), supporting standard row data, FileStream, and memory-optimized storage types. This is useful when you need to separate table storage across …
New-DbaDbMailAccount
Creates a new Database Mail account on SQL Server instances to enable automated email notifications, alerts, and reports. Database Mail accounts define the email settings (SMTP server, sender address, …
New-DbaDbMailProfile
Creates a new Database Mail profile on SQL Server instances, which serves as a container for organizing mail accounts used by SQL Server for notifications, alerts, and reports. Database Mail profiles …
New-DbaDbMaskingConfig
Analyzes SQL Server database tables and columns to automatically detect potentially sensitive information (PII) and generates a JSON configuration file that defines how to mask each identified column. …
New-DbaDbMasterKey
Creates a database master key, which is required for implementing Transparent Data Encryption (TDE), Always Encrypted, or other database-level encryption features. The master key serves as the root …
New-DbaDbRole
Creates custom database roles for implementing role-based security in SQL Server databases. This function handles the creation of user-defined database roles that can later be granted specific …
New-DbaDbSchema
Creates new database schemas within SQL Server databases, allowing you to organize database objects into logical groups and implement security boundaries. Schemas provide a way to separate tables, …
New-DbaDbSequence
Creates a new sequence object in one or more SQL Server databases, providing an alternative to IDENTITY columns for generating sequential numbers. This function allows you to configure all sequence …
New-DbaDbSnapshot
Creates read-only database snapshots that capture the state of a database at a specific moment in time. Snapshots provide a fast way to revert databases to a previous state without restoring from …
New-DbaDbSynonym
Creates database synonyms that serve as alternate names or aliases for database objects like tables, views, stored procedures, and functions. Synonyms simplify object references by providing shorter …
New-DbaDbTable
Creates new tables in SQL Server databases with specified columns, data types, constraints, and properties. You can define table structure using simple PowerShell hashtables for columns or pass in …
New-DbaDbTransfer
Returns a configured SMO Transfer object that defines what database objects to copy and how to copy them between SQL Server instances. This function prepares the transfer configuration but does not …
New-DbaDbUser
Creates database users across one or more databases, supporting multiple authentication types including traditional SQL login mapping, contained users with passwords, and Azure Active Directory …
New-DbaDiagnosticAdsNotebook
Converts Glenn Berry's well-known SQL Server diagnostic queries into a Jupyter Notebook (.ipynb) file that can be opened and executed in Azure Data Studio. The function automatically detects your SQL …
New-DbaDirectory
Creates directories on local or remote SQL Server machines by executing the xp_create_subdir extended stored procedure. This is particularly useful when you need to create backup directories, log …
New-DbaEndpoint
Creates SQL Server endpoints that enable communication between instances for high availability features like availability groups and database mirroring. Database mirroring endpoints are the most …
New-DbaFirewallRule
Creates inbound Windows firewall rules for SQL Server instances, Browser service, and Dedicated Admin Connection (DAC) to allow network connectivity. This automates the tedious post-installation task …
New-DbaLinkedServer
Creates a new linked server on a SQL Server instance, allowing you to query remote databases and heterogeneous data sources as if they were local tables. This replaces the need to manually configure …
New-DbaLinkedServerLogin
Creates linked server login mappings that define how local SQL Server logins authenticate to remote servers during distributed queries. You can either map specific local logins to remote credentials …
New-DbaLogin
⭐Creates new SQL Server logins supporting Windows Authentication, SQL Authentication, certificate-mapped, asymmetric key-mapped, and Azure AD authentication. Handles password policies, expiration …
New-DbaReplCreationScriptOptions
Creates a Microsoft.SqlServer.Replication.CreationScriptOptions object that controls which database objects and properties are included when replicating tables through SQL Server replication. This …
New-DbaReplPublication
Creates a new replication publication on a SQL Server instance that's already configured as a publisher. This function enables publishing on the specified database, creates necessary replication …
New-DbaReplSubscription
Creates push or pull subscriptions for SQL Server replication, connecting a subscriber instance to an existing publication on a publisher. This function handles the setup of transactional, snapshot, …
New-DbaRgResourcePool
Creates a new Resource Governor resource pool that defines specific limits for CPU, memory, and I/O resources on a SQL Server instance. Resource pools let you isolate different workloads by setting …
New-DbaRgWorkloadGroup
Creates a Resource Governor workload group within a specified resource pool, allowing you to define specific resource limits and priorities for different types of SQL Server workloads. Workload groups …
New-DbaScriptingOption
Creates a Microsoft.SqlServer.Management.Smo.ScriptingOptions object that controls how SQL Server objects get scripted into T-SQL CREATE statements. This object lets you customize what gets included …
New-DbaServerRole
Creates new server-level roles on one or more SQL Server instances, allowing you to implement custom security frameworks without manually using SSMS or T-SQL. Server roles provide a way to group …
New-DbaServiceMasterKey
Creates a service master key in the master database, which sits at the top of SQL Server's encryption hierarchy. The service master key automatically encrypts and protects database master keys, …
New-DbaSqlParameter
Creates a Microsoft.Data.SqlClient.SqlParameter object with specified properties like data type, direction, size, and value. This is essential for executing parameterized queries and stored procedures …
New-DbaSsisCatalog
Creates the SSIS Catalog database (SSISDB) which is required before you can deploy, manage, or execute SSIS packages on the server. Installing SQL Server with SSIS doesn't automatically create this …
New-DbatoolsSupportPackage
This function creates an extensive diagnostic package specifically designed to help the dbatools team troubleshoot module-related issues, bugs, or unexpected behavior. When you encounter problems with …
New-DbaXESession
Creates a new Extended Events session object that can be programmatically configured with events, actions, and targets before deployment to SQL Server. This function provides the foundation for …
Publish-DbaDacPackage
Deploys database schema changes from DACPAC files created by SSDT projects or Export-DbaDacPackage, automatically updating target database structure and executing embedded pre/post deployment scripts. …
Read-DbaAuditFile
Reads and parses SQL Server audit files (.sqlaudit) created by SQL Server Audit functionality, converting binary audit data into readable PowerShell objects. Each audit event is returned with its …
Read-DbaBackupHeader
Uses SQL Server's RESTORE HEADERONLY functionality to extract detailed metadata from backup files including database name, backup type, creation date, file lists, and backup size information. This …
Read-DbaTraceFile
Reads SQL Server trace files (.trc) using the fn_trace_gettable function and returns events as PowerShell objects for analysis. This function is essential for DBAs who need to investigate security …
Read-DbaTransactionLog
Uses SQL Server's built-in fn_dblog function to extract raw transaction log records from a live database, returning detailed information about every transaction in the format used by the SQL Server …
Read-DbaXEFile
Converts Extended Events trace files into PowerShell objects so you can analyze captured SQL Server events without needing SQL Server Management Studio. This function takes the raw XEvent data from …
Read-XEvent
Register-DbatoolsConfig
Registers an existing configuration object in registry. This allows simple persisting of settings across powershell consoles. It also can be used to generate a registry template, which can then be …
Remove-DbaAgDatabase
Removes databases from availability groups, effectively stopping replication and high availability protection for those databases. This is commonly needed when decommissioning databases, reconfiguring …
Remove-DbaAgentAlert
Deletes SQL Server Agent alerts that monitor for specific errors, performance conditions, or system events. Useful for cleaning up obsolete alerts, removing test configurations, or managing alert …
Remove-DbaAgentAlertCategory
Removes custom alert categories from SQL Server Agent, useful for cleaning up unused organizational structures or standardizing alert management across environments. Any existing alerts that reference …
Remove-DbaAgentJob
Removes SQL Server Agent jobs from the target instances using the sp_delete_job system stored procedure. By default, both job history and unused schedules are deleted along with the job itself. You …
Remove-DbaAgentJobCategory
Removes custom SQL Server Agent job categories that are no longer needed for job organization and management. This is useful when cleaning up obsolete categories after reorganizing jobs or migrating …
Remove-DbaAgentJobSchedule
Detaches one or more schedules from a SQL Server Agent job without deleting the schedule itself. This is equivalent to executing sp_detach_schedule in T-SQL. This is particularly useful when a …
Remove-DbaAgentJobStep
Removes individual job steps from SQL Server Agent jobs by step name. This function validates that both the job and step exist before attempting removal, preventing errors when cleaning up outdated or …
Remove-DbaAgentOperator
Removes SQL Server Agent operators from specified instances, cleaning up notification contacts that are no longer needed. Operators are notification contacts used by SQL Server Agent to send alerts …
Remove-DbaAgentProxy
Removes the SQL Agent proxy(s) that have passed through the pipeline. If not used with a pipeline, Get-DbaAgentProxy will be executed with the parameters provided and the returned SQL Agent proxy(s) …
Remove-DbaAgentSchedule
Removes SQL Server Agent schedules from the msdb database, handling both unused schedules and those currently assigned to jobs. The function first removes schedule associations from any jobs using the …
Remove-DbaAgListener
Removes availability group listeners from SQL Server instances, permanently deleting the virtual network name and IP address configuration that clients use to connect to availability group databases. …
Remove-DbaAgReplica
Removes secondary replicas from Availability Groups by calling the Drop() method on the replica object. This is commonly used when decommissioning servers, scaling down your availability group …
Remove-DbaAvailabilityGroup
Removes availability groups from SQL Server instances by executing the DROP AVAILABILITY GROUP T-SQL command. This is typically used when decommissioning high availability setups, migrating to …
Remove-DbaBackup
Recursively searches backup directories and removes SQL Server backup files older than your specified retention period. This function automates the tedious process of manually cleaning up old backup …
Remove-DbaClientAlias
Removes SQL Server client aliases from the Windows registry by deleting entries from both 32-bit and 64-bit registry locations. Client aliases redirect SQL Server connection requests to different …
Remove-DbaCmConnection
Clears cached connection objects that dbatools uses for remote computer management operations like accessing Windows services, registry, and file systems on SQL Server instances. When you run dbatools …
Remove-DbaComputerCertificate
Removes certificates from Windows certificate stores on local or remote computers using PowerShell remoting. This is essential for managing SSL/TLS certificates used by SQL Server instances for …
Remove-DbaCredential
Removes the SQL credential(s) that have passed through the pipeline. If not used with a pipeline, Get-DbaCredential will be executed with the parameters provided and the returned SQL credential(s) …
Remove-DbaCustomError
Removes custom error messages that applications have added to SQL Server's sys.messages catalog, cleaning up obsolete or unwanted user-defined messages with IDs between 50001 and 2147483647. This is …
Remove-DbaDatabase
Removes user databases by attempting three different drop methods in sequence until one succeeds. First tries the standard KillDatabase() method, then attempts to set the database to single-user mode …
Remove-DbaDatabaseSafely
Performs a comprehensive database removal workflow that validates database integrity, creates verified backups, and tests restore procedures before permanently removing databases. This function runs …
Remove-DbaDbAsymmetricKey
Removes asymmetric keys from SQL Server databases by executing DROP ASYMMETRIC KEY commands. Asymmetric keys are part of SQL Server's cryptographic hierarchy used for encryption, digital signatures, …
Remove-DbaDbBackupRestoreHistory
Removes backup and restore history records from MSDB database tables to prevent them from consuming excessive disk space and degrading performance. Over time, these history tables can grow …
Remove-DbaDbCertificate
Removes database certificates from specified SQL Server databases using the DROP CERTIFICATE statement. This function is commonly used during certificate rotation, security cleanup, or when …
Remove-DbaDbCheckConstraint
Removes check constraints from database tables across one or more SQL Server instances. Check constraints enforce data integrity by validating that column values meet specific criteria before allowing …
Remove-DbaDbData
Removes all data from user tables by truncating each table in the specified databases. When foreign keys or views exist that would prevent truncation, the function automatically scripts them out, …
Remove-DbaDbDataClassification
Removes all data classification metadata from table columns by dropping the four extended properties: - sys_information_type_id - sys_information_type_name - sys_sensitivity_label_id - …
Remove-DbaDbEncryptionKey
Removes database encryption keys (DEK) from specified databases by executing DROP DATABASE ENCRYPTION KEY. This is typically used when disabling Transparent Data Encryption (TDE) on a database or …
Remove-DbaDbFileGroup
Removes one or more filegroups from SQL Server databases after validating they contain no data files. This command is useful for cleaning up unused filegroups after moving data to different filegroups …
Remove-DbaDbLogShipping
Completely removes log shipping setup from both primary and secondary instances by cleaning up all associated SQL Agent jobs, monitor configurations, and database relationships stored in msdb. This …
Remove-DbaDbMailAccount
Permanently deletes Database Mail accounts from the specified SQL Server instances, removing them from the MSDB database configuration. This command is useful when decommissioning obsolete email …
Remove-DbaDbMailProfile
Deletes specified Database Mail profiles from the msdb database, permanently removing their configuration and preventing them from sending emails. This is commonly used during security hardening to …
Remove-DbaDbMasterKey
Removes database master keys from specified SQL Server databases by executing DROP MASTER KEY. Database master keys are used to encrypt other database-level encryption keys, including those for …
Remove-DbaDbMirror
Terminates database mirroring sessions by breaking the partnership between principal and mirror databases. This command stops the mirroring relationship completely, which is useful when …
Remove-DbaDbMirrorMonitor
Stops and deletes the mirroring monitor job for all the databases on the server instance. Basically executes sp_dbmmonitordropmonitoring.
Remove-DbaDbOrphanUser
Removes orphaned database users from one or more databases, handling schema ownership transfers automatically to prevent dependency issues. Orphaned users occur when a database user exists but its …
Remove-DbaDbPartitionFunction
Removes partition functions from specified databases across one or more SQL Server instances. Partition functions define the value ranges used to split table data across multiple filegroups, and …
Remove-DbaDbPartitionScheme
Removes partition schemes from specified databases across one or more SQL Server instances. Partition schemes define how partitioned tables and indexes map to filegroups, and this function helps clean …
Remove-DbaDbRole
Removes user-defined database roles from SQL Server databases while protecting against accidental deletion of system roles and intelligently handling schema ownership. This function automatically …
Remove-DbaDbRoleMember
Removes database users from specified database roles, supporting both built-in roles (like db_datareader, db_datawriter, db_owner) and custom database roles. This function streamlines user access …
Remove-DbaDbSchema
Removes database schemas from SQL Server databases using the DROP SCHEMA T-SQL command. This function is useful for cleaning up unused schemas during database maintenance, development environment …
Remove-DbaDbSequence
Removes sequence objects from SQL Server databases, freeing up schema namespace and cleaning up unused database objects. Sequences are commonly used for generating unique numeric values and may need …
Remove-DbaDbSnapshot
Removes database snapshots by executing DROP DATABASE statements against the target SQL Server instances. Database snapshots are point-in-time, read-only copies of databases that consume minimal space …
Remove-DbaDbSynonym
Removes one or more database synonyms from SQL Server databases by executing DROP SYNONYM commands. Synonyms are database objects that provide alternate names for tables, views, or other objects, …
Remove-DbaDbTable
Permanently removes tables from one or more databases using SQL Server Management Objects (SMO). This function provides a safer alternative to manual DROP TABLE statements by including built-in …
Remove-DbaDbTableData
Safely removes large amounts of table data without causing transaction log file growth issues that typically occur with single large DELETE operations. This command implements Aaron Bertrand's chunked …
Remove-DbaDbUdf
Removes user-defined functions and user-defined aggregates from specified databases, providing a clean way to drop obsolete or unwanted UDFs and UDAs without manual T-SQL scripting. This function is …
Remove-DbaDbUser
Safely removes database users from SQL Server databases while automatically handling schema ownership conflicts that would normally prevent user deletion. This eliminates the manual process of …
Remove-DbaDbView
Removes one or more database views from specified databases and SQL Server instances. This function streamlines the cleanup of obsolete views during database refactoring, development cleanup, or …
Remove-DbaEndpoint
Removes SQL Server endpoints by executing DROP ENDPOINT commands against the target instance. This function handles DatabaseMirroring, ServiceBroker, Soap, and TSql endpoint types, making it useful …
Remove-DbaExtendedProperty
Removes extended properties that contain custom metadata, documentation, and business descriptions from SQL Server objects. Extended properties are commonly used to store object documentation, version …
Remove-DbaFirewallRule
Removes Windows firewall rules for SQL Server components from target computers, cleaning up network access rules when decommissioning instances or changing security configurations. This command only …
Remove-DbaInstanceList
Removes SQL Server instance names from the user-maintained list that is pre-loaded into the dbatools tab completion cache for the -SqlInstance parameter. The instances are removed from the stored …
Remove-DbaLinkedServer
Removes one or more linked servers from target SQL Server instances. This function drops the linked server objects from the system catalog, effectively severing the connection between the local and …
Remove-DbaLinkedServerLogin
Removes linked server login mappings, which are the credential associations that determine how local SQL Server logins authenticate to remote servers through linked server connections. These mappings …
Remove-DbaLogin
Removes one or more SQL Server logins from specified instances using the SMO Drop() method. This function handles the complete removal process including dependency checks and provides proper error …
Remove-DbaNetworkCertificate
Removes the certificate thumbprint from SQL Server's network encryption configuration by clearing the Certificate registry value in SuperSocketNetLib. This disables forced SSL encryption for client …
Remove-DbaPfDataCollectorCounter
Removes performance counters from existing Data Collector Sets in Windows Performance Monitor. This allows you to clean up monitoring configurations by removing counters that are no longer needed, …
Remove-DbaPfDataCollectorSet
Removes Windows Performance Monitor Data Collector Sets that are no longer needed for SQL Server performance monitoring. This is useful for cleaning up old monitoring configurations, freeing disk …
Remove-DbaRegServer
Removes registered servers from SQL Server Central Management Server (CMS) or local registered server groups within SQL Server Management Studio. This command helps DBAs clean up outdated server …
Remove-DbaRegServerGroup
Deletes specified server groups from Central Management Server, including all nested subgroups and registered servers within those groups. This permanently removes the organizational structure you've …
Remove-DbaReplArticle
Removes articles from SQL Server replication publications, automatically handling subscription cleanup when subscribers exist. This function is essential when you need to stop replicating specific …
Remove-DbaReplPublication
Removes a publication from the database on the target SQL instances. …
Remove-DbaReplSubscription
Removes a subscription for the target SQL instances. https://learn.microsoft.com/en-us/sql/relational-databases/replication/delete-a-push-subscription?view=sql-server-ver16 …
Remove-DbaRgResourcePool
Removes user-defined resource pools from SQL Server's Resource Governor, freeing up the allocated memory, CPU, and IO resources for redistribution to other workloads. This is typically done when …
Remove-DbaRgWorkloadGroup
Removes specified workload groups from SQL Server Resource Governor and automatically reconfigures the Resource Governor so changes take effect immediately. Workload groups define resource allocation …
Remove-DbaServerRole
Removes custom server-level roles that are no longer needed from SQL Server instances. This function helps clean up security configurations by permanently dropping user-defined server roles while …
Remove-DbaServerRoleMember
Revokes membership from server-level roles by removing logins or nested roles from target roles like sysadmin, dbcreator, or custom server roles. This is essential for security management when you …
Remove-DbaSpn
Connects to Active Directory to remove specified SPNs from SQL Server service accounts and automatically cleans up associated Kerberos delegation settings. This is essential when decommissioning SQL …
Remove-DbaTrace
Stops active SQL Server traces and permanently removes their definitions from the server using sp_trace_setstatus. This function helps clean up unnecessary traces that may be consuming server …
Remove-DbaXESession
Removes Extended Events sessions from SQL Server instances, giving you the option to target specific sessions by name or remove all user-created sessions at once. This function preserves critical …
Rename-DbaDatabase
Systematically renames all database components using template-based naming conventions to enforce consistent standards across your SQL Server environment. This function addresses the common challenge …
Rename-DbaLogin
Renames SQL Server logins at the instance level, solving the common problem of needing to update login names after migrations, domain changes, or when improving naming conventions. When migrating …
Repair-DbaDbMirror
Restores database mirroring functionality when mirroring sessions become suspended due to network connectivity issues, log space problems, or other transient failures. This function performs the …
Repair-DbaDbOrphanUser
⭐Identifies and repairs orphaned database users - users that exist in a database but are no longer associated with a server login. This commonly occurs after database restores, migrations, or when …
Repair-DbaInstanceName
Updates SQL Server's @@SERVERNAME system variable to match the current Windows hostname, which is required after renaming a Windows server. This ensures proper functionality for Kerberos …
Reset-DbaAdmin
⭐Recovers access to SQL Server instances when you're locked out due to forgotten passwords, disabled accounts, or authentication issues. This emergency recovery tool stops the SQL Server service and …
Reset-DbatoolsConfig
Restores dbatools configuration settings to their original default values, useful when troubleshooting connectivity issues, fixing misconfigured connection strings, or starting fresh after environment …
Resolve-DbaNetworkName
Performs comprehensive network name resolution to gather detailed connection information for SQL Server instances and computers. This function is essential when you need to verify connectivity, …
Resolve-DbaPath
Validates and resolves file system paths with additional safety checks beyond PowerShell's built-in Resolve-Path cmdlet. This function ensures paths exist and are accessible before performing database …
Restart-DbaService
Restarts SQL Server services across multiple computers while automatically managing service dependencies and restart order. This function performs a controlled stop-then-restart sequence, ensuring …
Restore-DbaDatabase
⭐Scans backup files and automatically selects the optimal restore sequence to recover databases to a specific point in time. This function handles the complex task of building complete backup chains …
Restore-DbaDbCertificate
Restores database certificates and their associated private keys from backup files into SQL Server databases. This function is essential for recovering certificates used in TDE (Transparent Data …
Restore-DbaDbSnapshot
Restores SQL Server databases to their exact state when a database snapshot was created, discarding all changes made since that point. This is particularly useful for quickly reverting development …
Resume-DbaAgDbDataMovement
Resumes data movement for availability group databases that have been suspended due to errors, maintenance, or storage issues. When data movement is suspended, secondary replicas stop receiving …
Revoke-DbaAgPermission
Removes specific permissions from SQL Server logins on either database mirroring endpoints or availability groups. This is commonly needed when service accounts change roles, security policies require …
Save-DbaCommunitySoftware
Downloads and extracts popular SQL Server community tools from GitHub repositories to maintain a local cache used by dbatools installation commands. This function automatically manages the acquisition …
Save-DbaDiagnosticQueryScript
Downloads the latest versions of Glenn Berry's renowned SQL Server Diagnostic Information Queries from his website. These DMV-based scripts are essential tools for DBAs to assess SQL Server health, …
Save-DbaKbUpdate
Downloads Microsoft KB updates, cumulative updates, and service packs from Microsoft's servers to your local file system. This function handles SQL Server patches as well as any other Microsoft KB …
Select-DbaBackupInformation
Analyzes backup history objects and determines the exact sequence of backups required to restore a database to a specific point in time. This function handles the complex LSN logic to identify which …
Select-DbaDbSequenceNextValue
Executes a SELECT NEXT VALUE FOR statement against the specified sequence, which increments the sequence counter and returns the next value in the series. This is useful for testing sequence behavior, …
Select-DbaObject
Wrapper around Select-Object, extends property parameter. This function allows specifying in-line transformation of the properties specified without needing to use complex hashtables. For example, …
Set-DbaAgentAlert
Modifies existing SQL Agent alerts on one or more SQL Server instances, allowing you to enable, disable, or rename alerts without using SQL Server Management Studio. This function is particularly …
Set-DbaAgentJob
Updates various properties of SQL Server Agent jobs including job name, description, owner, enabled/disabled status, notification settings, and schedule assignments. This function lets you modify jobs …
Set-DbaAgentJobCategory
Renames existing SQL Server Agent job categories by updating their names in the msdb database. This is particularly useful for standardizing job category naming conventions across multiple …
Set-DbaAgentJobOutputFile
Modifies the output file location where SQL Server Agent writes job step execution details, error messages, and command output. This centralizes logging for troubleshooting failed jobs, monitoring …
Set-DbaAgentJobOwner
This function standardizes SQL Agent job ownership by updating jobs that don't match a specified owner login. It's commonly used for security compliance, post-migration cleanup, and environment …
Set-DbaAgentJobStep
Modifies SQL Agent job step properties including commands, subsystems, retry logic, success/failure actions, and execution context. Updates existing job steps by name or creates new steps when using …
Set-DbaAgentOperator
Modifies existing SQL Agent operators by updating their contact information, pager notification schedules, and failsafe operator configuration. This lets you change email addresses, pager contacts, …
Set-DbaAgentSchedule
Modifies the timing, frequency, and other properties of existing SQL Agent job schedules without recreating them. You can update schedule frequency (daily, weekly, monthly), change start/end times and …
Set-DbaAgentServer
Modifies SQL Server Agent configuration settings including logging levels, mail profiles, CPU monitoring thresholds, job history retention, and service restart behaviors. Use this to standardize agent …
Set-DbaAgListener
Modifies the port number for Availability Group listeners, allowing you to change the network port that clients use to connect to the availability group. This is commonly needed when standardizing …
Set-DbaAgReplica
Modifies configuration properties of existing availability group replicas such as availability mode, failover behavior, backup priority, and read-only routing settings. This function is used for …
Set-DbaAvailabilityGroup
Modifies configuration properties of existing availability groups without requiring you to script out and recreate the entire AG setup. Commonly used to enable DTC support for distributed …
Set-DbaCmConnection
Configures connection objects that dbatools uses to manage remote SQL Server host computers via CIM, WMI, and PowerShell remoting. This function creates new connection records for computers not yet …
Set-DbaDbCompatibility
Updates database compatibility levels across one or more SQL Server instances. When no specific compatibility level is provided, automatically sets each database to match the SQL Server instance …
Set-DbaDbCompression
Compresses tables, indexes, and heaps across one or more databases using Row, Page, or intelligent recommendations based on Microsoft's Tiger Team compression analysis. Automatically handles the …
Set-DbaDbDataClassification
Creates or updates data classification metadata on table columns by setting four extended properties: - sys_information_type_id: GUID identifying the information type - sys_information_type_name: …
Set-DbaDbFileGroup
Modifies key properties of database filegroups including setting the default filegroup for new objects, changing read-only status for data archival, and configuring auto-grow behavior across all files …
Set-DbaDbFileGrowth
Configures database file auto-growth settings using ALTER DATABASE statements to replace default percentage-based growth with fixed-size increments. This prevents unpredictable growth patterns that …
Set-DbaDbIdentity
Executes DBCC CHECKIDENT to verify the current identity value for tables with identity columns and optionally reseed them to a specific value. This is essential after bulk data operations, imports, or …
Set-DbaDbMailAccount
Modifies the configuration of an existing Database Mail account including account properties (display name, email address, description) and mail server settings (SMTP server name, port, SSL, and …
Set-DbaDbMirror
Modifies database mirroring configuration by setting the partner server, witness server, safety level, or changing the mirror state. This function lets you reconfigure existing mirrored databases …
Set-DbaDbOwner
Changes database ownership to standardize who owns your databases across an instance. This is particularly useful for maintaining consistent ownership patterns after restoring databases from other …
Set-DbaDbQueryStoreOption
Modifies Query Store configuration options for one or more databases, allowing you to control how SQL Server captures, stores, and manages query execution statistics. Query Store acts as a performance …
Set-DbaDbRecoveryModel
Changes the recovery model setting for one or more databases, allowing you to switch between Simple, Full, and BulkLogged recovery modes. This is commonly used when preparing databases for different …
Set-DbaDbSchema
Modifies the ownership of database schemas by updating the schema owner property in SQL Server. This is commonly needed when reorganizing database security, transferring ownership from developers to …
Set-DbaDbSequence
Modifies existing SQL Server sequence objects by updating their properties such as increment value, restart point, minimum and maximum bounds, cycling behavior, and cache settings. This function is …
Set-DbaDbState
Modifies database access modes and availability states through ALTER DATABASE commands, eliminating the need to write T-SQL manually for common database administration tasks. This function handles …
Set-DbaDefaultPath
Modifies the server-level default paths that SQL Server uses when creating new databases or performing backups without specifying explicit locations. This eliminates the need to manually specify file …
Set-DbaEndpoint
Modifies properties of existing SQL Server endpoints such as changing the owner for security compliance or switching the endpoint type between DatabaseMirroring, ServiceBroker, Soap, and TSql …
Set-DbaErrorLogConfig
Configures how SQL Server manages its error log files by setting retention count and automatic rollover size. You can specify how many error log files to keep (6-99) across all SQL Server versions, …
Set-DbaExtendedProperty
Updates the value of existing extended properties on SQL Server database objects. Extended properties store custom metadata like application versions, documentation, or business rules directly with …
Set-DbaExtendedProtection
Modifies the Extended Protection registry setting for SQL Server network protocols to enhance connection security. Extended Protection helps prevent authentication relay attacks by requiring …
Set-DbaLogin
Manages SQL Server login accounts by modifying passwords, account status, security settings, and server role memberships in a single operation. Handles common DBA tasks like unlocking accounts, …
Set-DbaMaxDop
Configures the max degree of parallelism setting to control how many processors SQL Server uses for parallel query execution. Without a specified value, the function automatically applies recommended …
Set-DbaMaxMemory
Modifies the SQL Server 'Max Server Memory' configuration to prevent SQL Server from consuming all available system memory. This setting controls how much memory SQL Server can allocate for its buffer …
Set-DbaNetworkCertificate
Sets the network certificate for SQL Server instance in two possible ways. This setting is found in Configuration Manager. Without the Certificate or Thumbprint parameter (Way One): Calls …
Set-DbaNetworkConfiguration
Modifies SQL Server network protocol settings through WMI, allowing you to enable or disable network protocols and configure TCP/IP properties like static or dynamic ports. This replaces the need to …
Set-DbaPowerPlan
Changes the Windows power plan on SQL Server host machines using WMI and PowerShell remoting. Defaults to High Performance, which prevents CPU throttling that can severely impact database query …
Set-DbaPrivilege
Configures critical Windows privileges for SQL Server service accounts including Lock Pages in Memory (LPIM), Instant File Initialization (IFI), Logon as Batch, Logon as Service, Generate Security …
Set-DbaResourceGovernor
Configures Resource Governor settings at the SQL Server instance level to control CPU, memory, and I/O resource allocation for different workloads. Resource Governor requires both being enabled on the …
Set-DbaRgResourcePool
Modifies resource allocation settings for existing Resource Governor pools to control how much CPU, memory, and disk I/O different workloads can consume. This lets you adjust performance limits after …
Set-DbaRgWorkloadGroup
Modifies configuration settings for Resource Governor workload groups, which control how SQL Server allocates CPU, memory, and parallelism resources to different categories of queries and connections. …
Set-DbaSpConfigure
This function safely modifies SQL Server instance-level configuration values that are normally changed through sp_configure. Use this when you need to adjust settings like max memory, xp_cmdshell, …
Set-DbaSpn
This function will connect to Active Directory and search for an account. If the account is found, it will attempt to add an SPN. Once the SPN is added, the function will also set delegation to that …
Set-DbaStartupParameter
Changes the startup parameters that SQL Server uses when the service starts, including paths to master database files, error log location, and various startup flags. These parameters are stored in the …
Set-DbaTcpPort
Configures TCP port settings for SQL Server instances by modifying the network configuration through SQL Server Configuration Manager functionality. This replaces the manual process of opening SQL …
Set-DbaTempDbConfig
Configures tempdb database files to follow Microsoft's recommended best practices for performance optimization. This function calculates the optimal number of data files based on logical CPU cores …
Set-DbatoolsConfig
This function creates or changes configuration values. These can be used to provide dynamic configuration information outside the PowerShell variable system.
Set-DbatoolsInsecureConnection
⭐Microsoft changed the default connection settings in SQL Server client libraries to require encryption and validate certificates, which can break existing dbatools scripts and connections in …
Set-DbatoolsPath
Configures or updates a path under a name. The path can be persisted using the "-Register" command. Paths setup like this can be retrieved using Get-DbatoolsPath.
Show-DbaDbList
Creates a Windows Presentation Framework dialog that connects to a SQL Server instance and presents all databases in a visual tree view for selection. This eliminates the need to hardcode database …
Show-DbaInstanceFileSystem
Similar to the remote file system popup you see when browsing a remote SQL Server in SQL Server Management Studio, this function allows you to traverse the remote SQL Server's file structure. This …
Start-DbaAgentJob
Starts one or more SQL Server Agent jobs that are currently idle. This function validates jobs are in an idle state before starting them and can optionally wait for job completion before returning …
Start-DbaDbEncryption
Automates the complete TDE implementation process from start to finish, handling all the complex key management steps that would otherwise require multiple manual commands. This function sets up the …
Start-DbaEndpoint
Starts stopped SQL Server endpoints that are required for Database Mirroring, Service Broker, SOAP, and custom TCP connections. Endpoints must be in a started state to accept network connections and …
Start-DbaMigration
⭐Start-DbaMigration consolidates most of the migration tools in dbatools into one command for complete instance migrations. This function serves as an "easy button" when you need to move an entire SQL …
Start-DbaPfDataCollectorSet
Starts Performance Monitor Data Collector Sets that have been configured to gather system performance data. This is useful for SQL Server performance troubleshooting when you need to collect OS-level …
Start-DbaService
Starts SQL Server services (Engine, Agent, Browser, FullText, SSAS, SSIS, SSRS, PolyBase, Launchpad) on one or more computers following proper dependency order. This function handles the complexity of …
Start-DbaTrace
Starts SQL Server traces that have been defined but are not currently running. This function activates traces by setting their status to 1 using sp_trace_setstatus, allowing you to begin collecting …
Start-DbaXESession
Activates Extended Events sessions that have been created but are not currently running. Extended Events sessions are SQL Server's lightweight monitoring framework used for troubleshooting performance …
Stop-DbaAgentJob
Stops currently executing SQL Server Agent jobs and returns the job objects for verification after the stop attempt. Perfect for halting runaway jobs during maintenance windows, stopping jobs that are …
Stop-DbaDbEncryption
Disables Transparent Data Encryption (TDE) on all user databases within a SQL Server instance by calling Disable-DbaDbEncryption for each encrypted database found. This function automatically excludes …
Stop-DbaEndpoint
Stops specific or all SQL Server endpoints on target instances. Endpoints are communication channels that SQL Server uses for features like Service Broker messaging, Database Mirroring, Availability …
Stop-DbaExternalProcess
Terminates external processes that were created by SQL Server, such as those spawned by xp_cmdshell, BCP operations, SSIS packages, or external script executions. This function is designed to work …
Stop-DbaPfDataCollectorSet
Stops running Performance Monitor Data Collector Sets that are actively collecting performance counters for SQL Server monitoring and analysis. This function interacts with the Windows Performance …
Stop-DbaProcess
Terminates SQL Server processes by targeting specific SPIDs, logins, hostnames, programs, or databases. This is essential for resolving blocking situations, stopping runaway queries that consume …
Stop-DbaService
Stops SQL Server services including Database Engine, SQL Agent, Reporting Services, Analysis Services, Integration Services, PolyBase, Launchpad, and other components across one or more computers. …
Stop-DbaTrace
Stops one or more running SQL Server traces by calling sp_trace_setstatus with a status of 0. This is useful when you need to stop traces created for troubleshooting, performance monitoring, or …
Stop-DbaXESession
Stops active Extended Events sessions that are currently collecting diagnostic data or monitoring SQL Server activity. This function helps DBAs manage resource usage by ending sessions that may be …
Suspend-DbaAgDbDataMovement
Temporarily halts data movement between primary and secondary replicas for specified availability group databases. This stops transaction log records from being sent to secondary replicas, which is …
Sync-DbaAvailabilityGroup
⭐Copies server-level objects from the primary replica to all secondary replicas in an availability group. Availability groups only synchronize databases, not the server-level dependencies that …
Sync-DbaLoginPassword
Syncs SQL Server authentication login passwords from a source to destination instance(s) without requiring knowledge of the actual passwords. Uses the same technique as Microsoft's sp_help_revlogin by …
Sync-DbaLoginPermission
⭐Syncs comprehensive login security settings from a source to destination SQL Server instance, ensuring logins have consistent permissions across environments. This function only modifies permissions …
Test-DbaAgentJobOwner
This function audits SQL Agent job ownership by comparing each job's current owner against a target login, typically 'sa' or another sysadmin account. Jobs owned by inappropriate accounts can pose …
Test-DbaAgPolicyState
Evaluates the health of SQL Server Availability Groups by checking them against Microsoft's predefined Always On policies from the Policy-Based Management framework. Returns one object per policy …
Test-DbaAgSpn
Checks whether the required SPNs are properly registered in Active Directory for each Availability Group listener's service account. This function queries AD to verify that both the …
Test-DbaAvailabilityGroup
Verifies that all replicas in an Availability Group are connected and communicating properly by checking ConnectionState across all replicas from the primary's perspective. This helps you identify …
Test-DbaBackupEncrypted
Examines SQL Server backup files to identify whether they contain encrypted data, either through backup encryption or Transparent Data Encryption (TDE). Uses RESTORE HEADERONLY and RESTORE …
Test-DbaBackupInformation
Performs comprehensive pre-restore validation on backup history objects to prevent restore failures before they occur. Input is typically from Format-DbaBackupInformation and gets parsed to verify …
Test-DbaBackupStorageCompatibility
Evaluates the most recent full backup for each selected database against the limits of a cloud backup storage provider. The initial provider is S3-compatible object storage for SQL Server 2022 and …
Test-DbaBuild
Evaluates SQL Server instances or build versions against organizational patching policies to determine compliance status. Returns detailed build information including service pack level, cumulative …
Test-DbaCmConnection
Tests remote computer connectivity across four different management protocols to determine the most reliable connection method for SQL Server administration tasks. This function evaluates connectivity …
Test-DbaComputerCertificateExpiration
Scans computer certificate stores to find certificates that are expired or will expire within a specified timeframe. This function focuses on certificates used for SQL Server network encryption, …
Test-DbaConnection
⭐Tests SQL Server instance connectivity while collecting detailed connection and environment information for troubleshooting. Returns authentication details, network configuration, TCP ports, and local …
Test-DbaConnectionAuthScheme
This command queries sys.dm_exec_connections to retrieve authentication and transport details for your current SQL Server session. By default, it returns key connection properties including …
Test-DbaDbCollation
Compares each database's collation against the SQL Server instance's default collation to identify mismatches. Database collation mismatches can cause string comparison issues, join failures, and …
Test-DbaDbCompatibility
Compares each database's compatibility level against the SQL Server instance's maximum supported compatibility level. This helps identify databases that may not be leveraging newer SQL Server features …
Test-DbaDbCompression
Performs comprehensive compression analysis on user tables and indexes to help DBAs identify storage optimization opportunities. Uses SQL Server's sp_estimate_data_compression_savings system procedure …
Test-DbaDbDataGeneratorConfig
Validates JSON configuration files created by New-DbaDbDataGeneratorConfig before using them with Invoke-DbaDbDataGenerator to populate tables with realistic fake data. The function performs …
Test-DbaDbDataMaskingConfig
Validates data masking configuration JSON files by checking column properties, data types, masking types, and action configurations against dbatools requirements. Returns detailed error information …
Test-DbaDbLogShipStatus
Queries the log shipping monitoring system to check the health of your log shipping configuration across primary and secondary instances. This function connects to your log shipping monitoring …
Test-DbaDbOwner
This function compares the current owner of each database against a target login and returns only databases that do NOT match the expected owner. By default, it checks against 'sa' (or the renamed …
Test-DbaDbQueryStore
Evaluates Query Store against a set of rules to match best practices. The rules are: * ActualState = ReadWrite (This means Query Store is enabled and collecting data.) * DataFlushIntervalInSeconds = …
Test-DbaDbRecoveryModel
When you switch a database into FULL recovery model, it will behave like a SIMPLE recovery model until a full backup is taken in order to begin a log backup chain. This function identifies the gap …
Test-DbaDiskAlignment
Tests disk partition alignment by checking if partition starting offsets align properly with common stripe unit sizes (64KB, 128KB, 256KB, 512KB, 1024KB). Misaligned disk partitions can cause …
Test-DbaDiskAllocation
Examines all NTFS volumes on target servers to verify they are formatted with 64KB allocation units, which is the recommended cluster size for optimal SQL Server performance. When checking a single …
Test-DbaDiskSpeed
Queries sys.dm_io_virtual_file_stats to measure read/write latency, throughput, and overall I/O performance for database files. Returns performance ratings from "Very Good" to "Serious I/O Bottleneck" …
Test-DbaEndpoint
Tests network connectivity to SQL Server endpoint TCP listener ports by attempting direct socket connections. This function validates that endpoint ports are accessible from the network level, which …
Test-DbaIdentityUsage
Scans IDENTITY columns across databases to calculate how much of the available seed range has been consumed based on data type limits (tinyint, smallint, int, bigint). This helps DBAs proactively …
Test-DbaInstanceName
When a SQL Server's host OS is renamed, the SQL Server should be as well. This helps with Availability Groups and Kerberos. This command compares the SQL Server instance name (from @@servername) with …
Test-DbaInstantFileInitialization
Audits Instant File Initialization (IFI) configuration for all SQL Server Engine services on the specified computer(s). IFI allows SQL Server to skip zeroing out data file space during file creation …
Test-DbaKerberos
This function performs a comprehensive suite of diagnostic checks to troubleshoot Kerberos authentication issues for SQL Server instances. It addresses the most common causes of Kerberos …
Test-DbaLastBackup
⭐Restores all or some of the latest backups and performs a DBCC CHECKDB. 1. Gathers information about the last full backups 2. Restores the backups to the Destination with a new name. If no Destination …
Test-DbaLinkedServerConnection
Validates that linked servers are properly configured and accessible by attempting to establish connections to each one. This function iterates through all linked servers on the target instances and …
Test-DbaLoginPassword
Tests SQL Server authentication logins for common weak password patterns using the PWDCOMPARE() function to validate password hashes stored in sys.sql_logins. This security audit function helps …
Test-DbaManagementObject
Checks the Global Assembly Cache (GAC) for Microsoft.SqlServer.Smo assemblies of specified versions. This function helps DBAs ensure the required SMO libraries are available before executing scripts …
Test-DbaMaxDop
Analyzes your SQL Server's Max Degree of Parallelism (MAXDOP) settings and compares them against Microsoft's recommended values based on your server's hardware configuration. This function examines …
Test-DbaMaxMemory
Analyzes server memory and SQL Server instances to calculate optimal max memory configuration settings. Uses a tiered algorithm that reserves appropriate memory for the operating system based on total …
Test-DbaMigrationConstraint
Prevents migration failures by identifying databases that use features incompatible with the destination SQL Server edition. This function queries sys.dm_db_persisted_sku_features to detect …
Test-DbaNetworkCertificate
Tests network certificate configuration for SQL Server instances in two ways. Without the Thumbprint parameter (Way One): Calls Get-DbaNetworkConfiguration to retrieve information about the currently …
Test-DbaNetworkLatency
This function is intended to help measure SQL Server network latency by establishing a connection and executing a simple query. This is a better than a simple ping because it actually creates the …
Test-DbaOptimizeForAdHoc
Checks the current value of the "optimize for ad-hoc workloads" server configuration option and compares it against the recommended setting of 1 (enabled). This setting helps prevent plan cache bloat …
Test-DbaPath
Verifies file and directory accessibility from SQL Server's perspective using the master.dbo.xp_fileexist extended stored procedure. This is essential before backup operations, restore tasks, or any …
Test-DbaPowerPlan
Audits Windows Power Plan settings on SQL Server hosts to ensure compliance with Microsoft's performance recommendations. SQL Server runs optimally with the "High Performance" power plan, which …
Test-DbaReplLatency
Creates tracer tokens in transactional replication publications and measures the time it takes for those tokens to travel from the publisher to the distributor, and from the distributor to each …
Test-DbaSpn
This function discovers SQL Server instances on target computers and validates their Service Principal Name (SPN) configuration for Kerberos authentication. It addresses the common problem of missing …
Test-DbaTempDbConfig
Performs a comprehensive audit of tempdb configuration against Microsoft's recommended best practices, returning detailed compliance results for each rule. This saves DBAs from manually checking …
Test-DbaWindowsLogin
Queries SQL Server for all Windows-based logins and groups, then validates each against Active Directory to identify security issues and cleanup opportunities. The function checks whether AD accounts …
Uninstall-DbaSqlWatch
Performs a complete uninstallation of the SqlWatch performance monitoring solution by removing all associated database objects, SQL Agent jobs, and historical data. This includes dropping all SqlWatch …
Unregister-DbatoolsConfig
Removes dbatools configuration settings that have been persisted to Windows registry or JSON configuration files. This lets you clean up module settings that were previously saved using …
Update-DbaBuildReference
Refreshes the comprehensive SQL Server build reference database that powers Get-DbaBuild and Test-DbaBuild functions with current patch level information. This database contains detailed mappings …
Update-DbaInstance
⭐Automates the complete process of applying SQL Server patches to eliminate the manual effort of updating multiple instances. This function handles the entire patching workflow from detection through …
Update-DbaMaintenanceSolution
Updates the stored procedures for Ola Hallengren's Maintenance Solution on SQL Server instances where it's already installed. This function downloads the latest version from GitHub and replaces only …
Update-DbaServiceAccount
Updates the service account credentials or changes just the password for SQL Server Engine and Agent services. When changing the service account, the affected service will be automatically restarted …
Update-Dbatools
⭐Updates the dbatools module by removing the current installation and replacing it with the latest version from PowerShell Gallery or GitHub. This function has been deprecated in favor of PowerShell's …
Watch-DbaDbLogin
Watch-DbaDbLogin queries sys.dm_exec_sessions and sys.dm_exec_requests DMVs to capture real-time connection activity across multiple SQL Server instances. It records login names, client hostnames, …
Watch-DbaXESession
Streams live event data from running Extended Events sessions, allowing real-time monitoring of database activity, performance issues, or security events. Each captured event is processed into a …
Write-DbaDbTableData
⭐Imports data from various sources (CSV files, DataTables, DataSets, PowerShell objects) into SQL Server tables using SqlBulkCopy for optimal performance. This command handles the heavy lifting of data …
* Based on website stats
dbatools