Sql​Server

This section contains the help topics for the SQL Server PowerShell cmdlets.

sqlserver

Add-​Sql​Availability​Database

Adds primary databases to an availability group or joins secondary databases to an availability group.

Add-​Sql​Availability​Group​Listener​Static​Ip

Adds a static IP address to an availability group listener.

Add-​Sql​Azure​Authentication​Context

Performs authentication to Azure and acquires an authentication token.

Add-​Sql​Column​Encryption​Key​Value

Adds an encrypted value for an existing column encryption key object in the database.

Add-​Sql​Firewall​Rule

Adds a Windows Firewall rule to allow connections to a specific instance of SQL Server.

Add-​Sql​Login

Creates a Login object in an instance of SQL Server.

Backup-​Sql​Database

Backs up SQL Server database objects.

Complete-​Sql​Column​Master​Key​Rotation

Completes the rotation of a column master key.

Convert-​Urn​To​Path

Converts a SQL Server Management Object URN to a Windows PowerShell provider path.

Convert​From-​Encoded​Sql​Name

Returns the original SQL Server identifier when given an identifier that has been encoded into a format usable in Windows PowerShell paths.

Convert​To-​Encoded​Sql​Name

Encodes extended characters in SQL Server names to formats usable in Windows PowerShell paths.

Disable-​Sql​Always​On

Disables the AlwaysOn availability groups feature for a server.

Enable-​Sql​Always​On

Enables the AlwaysOn availability groups feature.

Get-​Sql​Agent

Gets a SQL Agent object that is present in the target instance of SQL Server.

Get-​Sql​Agent​Job

Gets a SQL Agent Job object for each job that is present in the target instance of SQL Agent.

Get-​Sql​Agent​Job​History

Gets the job history present in the target instance of SQL Agent.

Get-​Sql​Agent​Job​Schedule

Gets a job schedule object for each schedule that is present in the target instance of SQL Agent Job.

Get-​Sql​Agent​Job​Step

Gets a SQL JobStep object for each step that is present in the target instance of SQL Agent Job.

Get-​Sql​Agent​Schedule

Gets a SQL job schedule object for each schedule that is present in the target instance of SQL Agent.

Get-​Sql​Column​Encryption​Key

Gets all column encryption key objects defined in the database, or gets one column encryption key object with the specified name.

Get-​Sql​Column​Master​Key

Gets the column master key objects defined in the database or gets one column master key object with the specified name.

Get-​Sql​Credential

Gets a SQL credential object.

Get-​Sql​Database

Gets a SQL database object for each database that is present in the target instance of SQL Server.

Get-​Sql​Error​Log

Gets the SQL Server error logs.

Get-​Sql​Instance

Gets a SQL Instance object for each instance of SQL Server that is present on the target computer.

Get-​Sql​Login

Returns Login objects in an instance of SQL Server.

Get-​Sql​Smart​Admin

Gets the SQL Smart Admin object and its properties.

Invoke-​Policy​Evaluation

Invokes one or more SQL Server policy-based management policy evaluations.

Invoke-​Sql​Column​Master​Key​Rotation

Initiates the rotation of a column master key.

Invoke-​Sqlcmd

Runs a script containing statements supported by the SQL Server SQLCMD utility.

Join-​Sql​Availability​Group

Joins the local secondary replica to an availability group.

New-​Sql​Availability​Group

Creates an availability group.

New-​Sql​Availability​Group​Listener

Creates an availability group listener and attaches it to an availability group.

New-​Sql​Availability​Replica

Creates an availability replica.

New-​Sql​Azure​Key​Vault​Column​Master​Key​Settings

Creates a SqlColumnMasterKeySettings object describing an asymmetric key stored in Azure Key Vault.

New-​Sql​Backup​Encryption​Option

Creates the encryption options for the Backup-SqlDatabase cmdlet or the Set-SqlSmartAdmin cmdlet.

New-​Sql​Certificate​Store​Column​Master​Key​Settings

Creates a SqlColumnMasterKeySettings object referencing the specified certificate.

New-​Sql​Cng​Column​Master​Key​Settings

Creates a SqlColumnMasterKeySettings object describing an asymmetric key stored in a key store supporting the CNG API.

New-​Sql​Column​Encryption​Key

Crates a column encryption key object in the database.

New-​Sql​Column​Encryption​Key​Encrypted​Value

Creates the encrypted value of a column encryption key.

New-​Sql​Column​Encryption​Settings

Creates a SqlColumnEncryptionSettings object that encapsulates information about a single column's encryption, including CEK and encryption type.

New-​Sql​Column​Master​Key

Creates a column master key object in the database.

New-​Sql​Column​Master​Key​Settings

Creates a SqlColumnMasterKeySettings object.

New-​Sql​Credential

Creates a SQL Server credential object.

New-​Sql​Csp​Column​Master​Key​Settings

Creates a SqlColumnMasterKeySettings object describing an asymmetric key stored in a key store with a CSP supporting CAPI.

New-​Sql​HA​DR​Endpoint

Creates a database mirroring endpoint on a SQL Server instance.

Read-​Sql​Table​Data

Reads data from a table of a SQL database.

Read-​Sql​View​Data

Reads data from the view of a SQL database.

Remove-​Sql​Availability​Database

Removes an availability database from its availability group.

Remove-​Sql​Availability​Group

Removes an availability group.

Remove-​Sql​Availability​Replica

Removes a secondary availability replica.

Remove-​Sql​Column​Encryption​Key

Removes the column encryption key object from the database.

Remove-​Sql​Column​Encryption​Key​Value

Removes an encrypted value from an existing column encryption key object in the database.

Remove-​Sql​Column​Master​Key

Removes the column master key object from the database.

Remove-​Sql​Credential

Removes the SQL credential object.

Remove-​Sql​Firewall​Rule

Disables the Windows Firewall rule that allows connections to a specific instance of SQL Server.

Remove-​Sql​Login

Removes Login objects from an instance of SQL Server.

Restore-​Sql​Database

Restores a database from a backup or transaction log records.

Resume-​Sql​Availability​Database

Resumes data movement on an availability database.

Save-​Sql​Migration​Report
Set-​Sql​Authentication​Mode

Configures the authentication mode of the target instance of SQL Server.

Set-​Sql​Availability​Group

Sets settings on an availability group.

Set-​Sql​Availability​Group​Listener

Sets the port setting on an availability group listener.

Set-​Sql​Availability​Replica

Sets the settings on an availability replica.

Set-​Sql​Column​Encryption

Encrypts, decrypts, or re-encrypts specified columns in the database.

Set-​Sql​Credential

Sets the properties for the SQL Credential object.

Set-​Sql​Error​Log

Sets or resets the maximum number of error log files before they are recycled.

Set-​Sql​HA​DR​Endpoint

Sets the properties of a database mirroring endpoint.

Set-​Sql​Network​Configuration

Sets the network configuration of the target instance of SQL Server.

Set-​Sql​Smart​Admin

Configures or modifies backup retention and storage settings.

Start-​Sql​Instance

Starts the specified instance of SQL Server.

Stop-​Sql​Instance

Stops the specified instance of SQL Server.

Suspend-​Sql​Availability​Database

Suspends data movement on an availability database.

Switch-​Sql​Availability​Group

Starts a failover of an availability group to a secondary replica.

Test-​Sql​Availability​Group

Evaluates the health of an availability group.

Test-​Sql​Availability​Replica

Evaluates the health of availability replicas.

Test-​Sql​Database​Replica​State

Evaluates the health of an availability database.

Test-​Sql​Smart​Admin

Tests the health of Smart Admin by evaluating SQL Server policy based management (PBM) policies.

Write-​Sql​Table​Data

Writes data to a table of a SQL database.