Export-DbaBinaryFile View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Extracts binary data from SQL Server tables and writes it to physical files
Description 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 using binary, varbinary, or image datatypes.
The function automatically detects filename and binary data columns based on column names and datatypes, but you can specify custom columns if needed.
Export-DbaDbRole View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Generates T-SQL scripts for database role definitions with their complete permission sets and schema ownership
Description 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 granted to custom roles across all database securables like tables, schemas, assemblies, and certificates so you can recreate identical security configurations in other environments.
Export-DbaDbTableData View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Generates INSERT statements from table data for migration and deployment scripts
Description 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, lookup data, or configuration tables where you need the actual data values rather than just the table structure. The generated scripts include proper USE database context and can be saved to files or piped to other commands for further processing.
Export-DbaInstance View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Exports complete SQL Server instance configuration as T-SQL scripts for migration or disaster recovery
Description 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 work when migrating instances to new servers, creating disaster recovery scripts, or documenting configurations for compliance.
Export-DbaLogin View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Generates T-SQL scripts to recreate SQL Server logins with their complete security context for migration and disaster recovery.
Description 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 database), server-level permissions and role memberships, database user mappings and roles, plus SQL Agent job ownership assignments.
Export-DbaScript View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Generates T-SQL CREATE scripts from SQL Server Management Objects for migration and deployment
Description 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, logins, stored procedures, and more for migration between environments or backup purposes. The function handles proper formatting with batch separators and supports custom scripting options to control what gets included in the output.
Export-DbaServerRole View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Generates T-SQL scripts for server-level roles including permissions and memberships
Description 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 configurations during server migrations or disaster recovery scenarios. The function queries sys.server_permissions to capture all role permissions (GRANT, DENY, REVOKE) and generates the appropriate T-SQL statements for role creation and member assignments.
Export-DbaSysDbUserObject View Source Jess Pomfret (@jpomfret) Windows, Linux, macOS Synopsis Discovers and exports user-created objects from SQL Server system databases (master, model, msdb) to SQL script files.
Description 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 function helps DBAs document custom objects that may have been inadvertently created in system databases, which is critical for server migrations, compliance audits, and maintaining clean system database environments.
Export-DbaUser View Source Claudio Silva (@ClaudioESSilva) Windows, Linux, macOS Synopsis Generates T-SQL scripts to recreate database users with their complete security context including roles and permissions
Description 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, database-level permissions (like CONNECT, SELECT, INSERT), and granular object-level permissions for tables, views, stored procedures, functions, and other database objects.
Get-DbaBinaryFileTable View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Identifies tables containing binary columns and their associated filename columns for file extraction operations.
Description 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 essential when you need to extract files that have been stored as BLOBs in SQL Server tables but aren’t sure which tables contain binary data or how the filenames are stored.