You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This command requires access to the Windows OS via PowerShell remoting. Use this credential to connect to Windows using alternative credentials.<br></p>
615
+
<p>Login to the target OS using alternative credentials. Accepts credential objects (Get-Credential)<br/>
616
+
Only used when passwords are being exported, as it requires access to the Windows OS via PowerShell remoting to decrypt the passwords.<br></p>
<p>Database Mail is commonly used for automated alerts, backup notifications, job failure reports, and maintenance notifications. This function saves significant manual configuration time when setting up new servers, standardizing mail configurations across environments, or migrating to new hardware.</p>
492
492
<p>The function preserves all SMTP authentication details including encrypted passwords, handles name conflicts with optional force replacement, and can enable Database Mail on the destination if it's enabled on the source. You can migrate specific component types or the entire configuration in one operation.</p>
<p>Limits migration to specific Database Mail component types instead of copying everything. Choose 'ConfigurationValues' for global settings like retry attempts and file size limits, 'Profiles' for<br/>
597
-
mail profile definitions, 'Accounts' for SMTP account configurations, or 'MailServers' for SMTP server details.<br/>
598
-
Use this when you only need to sync specific components or when troubleshooting individual Database Mail layers.<br></p>
<p>Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).<br/>
661
-
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.<br/>
662
-
For MFA support, please use Connect-DbaInstance.<br></p>
659
+
<h5id="credential">-Credential</h5>
660
+
<p>Login to the target OS using alternative credentials. Accepts credential objects (Get-Credential)<br/>
661
+
Only used when passwords are being exported, as it requires access to the Windows OS via PowerShell remoting to decrypt the passwords.<br></p>
662
+
<table>
663
+
<thead>
664
+
<tr>
665
+
<th></th>
666
+
<th></th>
667
+
</tr>
668
+
</thead>
669
+
<tbody>
670
+
<tr>
671
+
<td>Alias</td>
672
+
<td></td>
673
+
</tr>
674
+
<tr>
675
+
<td>Required</td>
676
+
<td>False</td>
677
+
</tr>
678
+
<tr>
679
+
<td>Pipeline</td>
680
+
<td>false</td>
681
+
</tr>
682
+
<tr>
683
+
<td>Default Value</td>
684
+
<td></td>
685
+
</tr>
686
+
</tbody>
687
+
</table>
688
+
<h5id="type">-Type</h5>
689
+
<p>Limits migration to specific Database Mail component types instead of copying everything. Choose 'ConfigurationValues' for global settings like retry attempts and file size limits, 'Profiles' for<br/>
690
+
mail profile definitions, 'Accounts' for SMTP account configurations, or 'MailServers' for SMTP server details.<br/>
691
+
Use this when you only need to sync specific components or when troubleshooting individual Database Mail layers.<br></p>
<p>Creates a new computer certificate useful for Forcing Encryption</p>
489
489
<h2id="description">Description</h2>
490
490
<p>Creates a new computer certificate - self-signed or signed by an Active Directory CA, using the Web Server certificate.</p>
491
-
<p>By default, a key with a length of 1024 and a friendly name of the machines FQDN is generated.</p>
491
+
<p>By default, a key with a length of 2048 bits and a friendly name of "SQL Server" is generated.</p>
492
492
<p>This command was originally intended to help automate the process so that SSL certificates can be available for enforcing encryption on connections.</p>
493
493
<p>It makes a lot of assumptions - namely, that your account is allowed to auto-enroll and that you have permission to do everything it needs to do ;)</p>
<p>Creates a computer certificate signed by the local domain CA <em>on the local machine</em> for server1 with the keylength of 1024.<br>
533
+
<p>Creates a computer certificate signed by the local domain CA <em>on the local machine</em> for server1 with the keylength of 2048 and SHA-256 hashing.<br>
534
534
The certificate is then copied to the new machine over WinRM and imported.<br></p>
<p>Will restore the backup held at <ahref="http://demo.blob.core.windows.net/backups/dbbackup.bak">http://demo.blob.core.windows.net/backups/dbbackup.bak</a> to server1\instance1. The connection to Azure will be made using the<br>
646
646
credential MyAzureCredential held on instance Server1\instance1<br></p>
<p>Restores the backups from \ServerName\ShareName\File as database, stops before the first 'OvernightStart' mark that occurs after '21:00 10/05/2020'.<br>
732
732
Note that Date time needs to be specified in your local SQL Server culture<br></p>
733
+
<h5id="example-19">Example: 19</h5>
734
+
<pre><code>PS C:\> # Restore from S3 storage folder (SQL Server 2022+)
735
+
PS C:\> # First, enumerate S3 bucket contents using AWS PowerShell module - You need to be authenticated!
<p>Demonstrates the recommended workflow for restoring from S3 storage. Since SQL Server cannot enumerate S3 bucket contents via T-SQL, you must first use PowerShell's Get-S3Object cmdlet to list backup <br>
743
+
files, then pass the full S3 URLs to Restore-DbaDatabase.<br>
744
+
The StorageCredential parameter should reference a SQL Server credential configured for S3 access.<br></p>
For S3 storage (SQL Server 2022+): S3 bucket contents cannot be enumerated using T-SQL. You must provide explicit file paths or use PowerShell's Get-S3Object cmdlet (from AWS.Tools.S3 module) to<br/>
779
+
retrieve the list of backup files first, then pass them to this command. See examples for S3 usage patterns. <br></p>
0 commit comments