Thor Logo dbatools

Object

Export-DbaSysDbUserObject

Jess Pomfret (@jpomfret)

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.

Read more

Find-DbaUserObject

Stephen Bennett, sqlnotesfromtheunderground.wordpress.com

Find-DbaUserObject View Source Stephen Bennett, sqlnotesfromtheunderground.wordpress.com Windows, Linux, macOS Synopsis Finds SQL Server objects owned by users other than sa or dbo, or searches for objects owned by a specific user pattern. Description 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 need to know what objects they own to avoid breaking dependencies.

Read more

Get-DbaModule

Brandon Abshire, netnerds.net

Get-DbaModule View Source Brandon Abshire, netnerds.net Windows, Linux, macOS Synopsis Retrieves database modules (stored procedures, functions, views, triggers) modified after a specified date Description 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 deployment verification. Essential for identifying which stored procedures, functions, views, or triggers were altered during maintenance windows or after application deployments.

Read more

Invoke-DbaDbTransfer

Kirill Kravtsov (@nvarscar)

Invoke-DbaDbTransfer View Source Kirill Kravtsov (@nvarscar) Windows, Linux, macOS Synopsis Transfers database objects and data between SQL Server instances or databases using SMO Transfer objects. Description 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 object deployment scenarios where you need to copy specific objects or data without doing a full database restore.

Read more

New-DbaDbTransfer

Kirill Kravtsov (@nvarscar)

New-DbaDbTransfer View Source Kirill Kravtsov (@nvarscar) Windows, Linux, macOS Synopsis Creates a configured SMO Transfer object for copying database objects between SQL Server instances Description 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 execute the actual copy operation - you must call .TransferData() on the returned object or pipe it to Invoke-DbaDbTransfer to perform the transfer.

Read more

New-DbaScriptingOption

Chrissy LeMaire (@cl), netnerds.net

New-DbaScriptingOption View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Creates a customizable SMO ScriptingOptions object for controlling T-SQL script generation Description 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 when using Export-DbaScript and other dbatools scripting commands - things like whether to include indexes, triggers, permissions, dependencies, or batch separators. Perfect for creating deployment scripts where you need specific control over what gets scripted and how it’s formatted.

Read more