Thor Logo dbatools

Owner

Set-DbaDbOwner

Michael Fal (@Mike_Fal), mikefal.net

Set-DbaDbOwner View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Changes database ownership to a specified login when current ownership doesn’t match the target. Description 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 environments, where databases may have orphaned owners or inconsistent ownership.

Read more

Test-DbaAgentJobOwner

Michael Fal (@Mike_Fal), mikefal.net

Test-DbaAgentJobOwner View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Identifies SQL Agent jobs with incorrect ownership for security compliance auditing Description 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 security risks, especially if those accounts are disabled, deleted, or have reduced permissions.

Read more

Test-DbaDbOwner

Michael Fal (@Mike_Fal), mikefal.net

Test-DbaDbOwner View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Identifies databases with incorrect ownership for security compliance and best practice enforcement. Description 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 sysadmin account if ‘sa’ was changed), but you can specify any valid login.

Read more