Skip to content
Permalink
Browse files

1.0.51

  • Loading branch information...
potatoqualitee committed Oct 1, 2019
1 parent 0ac8c19 commit 400573d35b134c60129abfd0cdbe808516ac3213
Showing with 103 additions and 2 deletions.
  1. +27 −0 allcommands.ps1
  2. +63 −0 bin/dbatools-index.json
  3. +2 −1 dbatools.psd1
  4. +1 −0 dbatools.psm1
  5. +10 −1 en-us/dbatools-help.xml
@@ -1038,6 +1038,33 @@ function Add-DbaServerRoleMember {
}
}

#.ExternalHelp dbatools-Help.xml
function Backup-DbaComputerCertificate {

[CmdletBinding()]
param (
[Alias("Password")]
[SecureString]$SecurePassword,
[parameter(ValueFromPipeline, Mandatory)]
[object[]]$InputObject,
[string]$Path = $pwd,
[string]$FilePath,
[ValidateSet("Authenticode", "Cert", "Pfx", "Pkcs12", "Pkcs7", "SerializedCert")]
[string]$Type = "Cert",
[switch]$EnableException
)
process {
foreach ($cert in $InputObject) {
if ((Test-Bound -Parameter FilePath -Not)) {
$FilePath = "$Path\$($cert.ComputerName)-$($cert.Thumbprint).cer"
}
$certfromraw = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($cert.RawData, $SecurePassword)
[io.file]::WriteAllBytes($FilePath, $certfromraw.Export($Type))
Get-ChildItem $FilePath
}
}
}

#.ExternalHelp dbatools-Help.xml
function Backup-DbaDatabase {

@@ -1059,6 +1059,69 @@
],
"Syntax": "Add-DbaServerRoleMember [[-SqlInstance] \u003cDbaInstanceParameter[]\u003e] [[-SqlCredential] \u003cPSCredential\u003e] [[-ServerRole] \u003cString[]\u003e] [[-Login] \u003cString[]\u003e] [[-Role] \u003cString[]\u003e] [[-InputObject] \u003cObject[]\u003e] [-EnableException] [-WhatIf] [-Confirm] [\u003cCommonParameters\u003e]"
},
{
"Name": "Backup-DbaComputerCertificate",
"Description": "Backs up a computer certificate - useful for older systems and backing up remote certs to local disk.",
"Tags": "Certificate",
"Synopsis": "Backs up a computer certificate - useful for older systems and backing up remote certs to local disk.",
"Alias": "",
"Author": "Chrissy LeMaire (@cl), netnerds.net",
"CommandName": "Backup-DbaComputerCertificate",
"Availability": "Windows only",
"Links": null,
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eGet-DbaComputerCertificate | Backup-DbaComputerCertificate -Path C:\\temp\nBacks up all certs to C:\\temp. Auto-names the files.\n-------------------------- EXAMPLE 2 --------------------------\nPS C:\\\u003eGet-DbaComputerCertificate -Thumbprint 29C469578D6C6211076A09CEE5C5797EEA0C2713 | Backup-DbaComputerCertificate -FilePath C:\\temp\\29C469578D6C6211076A09CEE5C5797EEA0C2713.cer\nBacks up certificate with the thumbprint 29C469578D6C6211076A09CEE5C5797EEA0C2713 to the temp directory.",
"Params": [
[
"SecurePassword",
"Export using a password",
"Password",
false,
"false",
""
],
[
"InputObject",
"The target certificate object. Accepts input from Get-DbaComputerCertificate.",
"",
true,
"true (ByValue)",
""
],
[
"Path",
"Export to a directory",
"",
false,
"false",
"$pwd"
],
[
"FilePath",
"Export to a specific file name",
"",
false,
"false",
""
],
[
"Type",
"Export type. Options include: Authenticode, Cert, Pfx, Pkcs12, Pkcs7, SerializedCert.",
"",
false,
"false",
"Cert"
],
[
"EnableException",
"By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.\r\nThis avoids overwhelming you with \"sea of red\" exceptions, but is inconvenient because it basically disables advanced scripting.\r\nUsing this switch turns this \"nice by default\" feature off and enables you to catch exceptions with your own try/catch.",
"",
false,
"false",
"False"
]
],
"Syntax": "Backup-DbaComputerCertificate [[-SecurePassword] \u003cSecureString\u003e] [-InputObject] \u003cObject[]\u003e [[-Path] \u003cString\u003e] [[-FilePath] \u003cString\u003e] [[-Type] \u003cString\u003e] [-EnableException] [\u003cCommonParameters\u003e]"
},
{
"Name": "Backup-DbaDatabase",
"Description": "Performs a backup of a specified type of 1 or more databases on a single SQL Server Instance. These backups may be Full, Differential or Transaction log backups.",
@@ -11,7 +11,7 @@
RootModule = 'dbatools.psm1'

# Version number of this module.
ModuleVersion = '1.0.50'
ModuleVersion = '1.0.51'

# ID used to uniquely identify this module
GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789'
@@ -599,6 +599,7 @@
'New-DbaComputerCertificate',
'Get-DbaComputerCertificate',
'Add-DbaComputerCertificate',
'Backup-DbaComputerCertificate',
'Get-DbaNetworkCertificate',
'Set-DbaNetworkCertificate',
'Invoke-DbaDbLogShipping',
@@ -850,6 +850,7 @@ $script:windowsonly = @(
'New-DbaComputerCertificate',
'Get-DbaComputerCertificate',
'Add-DbaComputerCertificate',
'Backup-DbaComputerCertificate',
'Get-DbaNetworkCertificate',
'Set-DbaNetworkCertificate',
'Invoke-DbaDbLogShipping',
Adds login1 on the server localhost to the server-level roles bulkadmin and dbcreator </maml:para></dev:remarks></command:example><command:example><maml:title> -------------------------- EXAMPLE 7 -------------------------- </maml:title><maml:introduction><maml:para> PS C:\&gt; </maml:para></maml:introduction><dev:code> PS C:\ $logins = Get-Content C:\logins.txt </dev:code><dev:remarks><maml:para> PS C:\ $srvLogins = Get-DbaLogin -SqlInstance server1 -Login $logins
PS C:\ New-DbaServerRole -SqlInstance server1 -ServerRole mycustomrole -Owner sa | Add-DbaServerRoleMember -Login $logins

Adds all the logins found in C:\logins.txt to the newly created server-level role mycustomrole on server1. </maml:para></dev:remarks></command:example></command:examples><maml:relatedLinks><maml:navigationLink><maml:linkText></maml:linkText><maml:uri>https://dbatools.io/Add-DbaServerRoleMember</maml:uri></maml:navigationLink></maml:relatedLinks></command:command><command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"><command:details><command:name>Backup-DbaDatabase</command:name><command:noun>DbaDatabase</command:noun><command:verb>Backup</command:verb><maml:description><maml:para>Backup one or more SQL Sever databases from a single SQL Server SqlInstance.</maml:para></maml:description></command:details><maml:description><maml:para>Performs a backup of a specified type of 1 or more databases on a single SQL Server Instance. These backups may be Full, Differential or Transaction log backups.</maml:para></maml:description><command:syntax><command:syntaxItem><maml:name>Backup-DbaDatabase</maml:name><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>SqlCredential</maml:name><maml:description><maml:para>Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Adds all the logins found in C:\logins.txt to the newly created server-level role mycustomrole on server1. </maml:para></dev:remarks></command:example></command:examples><maml:relatedLinks><maml:navigationLink><maml:linkText></maml:linkText><maml:uri>https://dbatools.io/Add-DbaServerRoleMember</maml:uri></maml:navigationLink></maml:relatedLinks></command:command><command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"><command:details><command:name>Backup-DbaComputerCertificate</command:name><command:noun>DbaComputerCertificate</command:noun><command:verb>Backup</command:verb><maml:description><maml:para>Backs up a computer certificate - useful for older systems and backing up remote certs to local disk.</maml:para></maml:description></command:details><maml:description><maml:para>Backs up a computer certificate - useful for older systems and backing up remote certs to local disk.</maml:para></maml:description><command:syntax><command:syntaxItem><maml:name>Backup-DbaComputerCertificate</maml:name><command:parameter required="false" position="0" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>SecurePassword</maml:name><maml:description><maml:para>Export using a password</maml:para></maml:description><command:parameterValue required="false" variableLength="true">Securestring</command:parameterValue><dev:type><maml:name>Securestring</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="true" position="1" pipelineInput="True (ByValue)" aliases="" variableLength="true" globbing="false"><maml:name>InputObject</maml:name><maml:description><maml:para>The target certificate object. Accepts input from Get-DbaComputerCertificate.</maml:para></maml:description><command:parameterValue required="true" variableLength="true">System.Object[]</command:parameterValue><dev:type><maml:name>System.Object[]</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="2" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>Path</maml:name><maml:description><maml:para>Export to a directory</maml:para></maml:description><command:parameterValue required="false" variableLength="true">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="3" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>FilePath</maml:name><maml:description><maml:para>Export to a specific file name</maml:para></maml:description><command:parameterValue required="false" variableLength="true">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="4" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>Type</maml:name><maml:description><maml:para>Export type. Options include: Authenticode, Cert, Pfx, Pkcs12, Pkcs7, SerializedCert.</maml:para></maml:description><command:parameterValue required="false" variableLength="true">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>EnableException</maml:name><maml:description><maml:para>By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.</maml:para></maml:description><command:parameterValue required="false" variableLength="true">Switch</command:parameterValue><dev:type><maml:name>Switch</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter></command:syntaxItem></command:syntax><command:parameters><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>EnableException</maml:name><maml:description><maml:para>By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.</maml:para></maml:description><command:parameterValue required="false" variableLength="true">Switch</command:parameterValue><dev:type><maml:name>Switch</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>FilePath</maml:name><maml:description><maml:para>Export to a specific file name</maml:para></maml:description><command:parameterValue required="false" variableLength="true">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>InputObject</maml:name><maml:description><maml:para>The target certificate object. Accepts input from Get-DbaComputerCertificate.</maml:para></maml:description><command:parameterValue required="false" variableLength="true">System.Object[]</command:parameterValue><dev:type><maml:name>System.Object[]</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>Path</maml:name><maml:description><maml:para>Export to a directory</maml:para></maml:description><command:parameterValue required="false" variableLength="true">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>SecurePassword</maml:name><maml:description><maml:para>Export using a password</maml:para></maml:description><command:parameterValue required="false" variableLength="true">Securestring</command:parameterValue><dev:type><maml:name>Securestring</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>Type</maml:name><maml:description><maml:para>Export type. Options include: Authenticode, Cert, Pfx, Pkcs12, Pkcs7, SerializedCert.</maml:para></maml:description><command:parameterValue required="false" variableLength="true">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter></command:parameters><maml:alertSet><maml:title></maml:title><maml:alert><maml:para> Tags: Certificate
Author: Chrissy LeMaire (@cl), netnerds.net

Website: https://dbatools.io
Copyright: (c) 2018 by dbatools, licensed under MIT
License: MIT https://opensource.org/licenses/MIT </maml:para></maml:alert></maml:alertSet><command:examples><command:example><maml:title> -------------------------- EXAMPLE 1 -------------------------- </maml:title><maml:introduction><maml:para> PS C:\&gt; </maml:para></maml:introduction><dev:code> Get-DbaComputerCertificate | Backup-DbaComputerCertificate -Path C:\temp </dev:code><dev:remarks><maml:para> Backs up all certs to C:\temp. Auto-names the files. </maml:para></dev:remarks></command:example><command:example><maml:title> -------------------------- EXAMPLE 2 -------------------------- </maml:title><maml:introduction><maml:para> PS C:\&gt; </maml:para></maml:introduction><dev:code> Get-DbaComputerCertificate -Thumbprint 29C469578D6C6211076A09CEE5C5797EEA0C2713 | Backup-DbaComputerCertificate -FilePath C:\temp\29C469578D6C6211076A09CEE5C5797EEA0C2713.cer </dev:code><dev:remarks><maml:para> Backs up certificate with the thumbprint 29C469578D6C6211076A09CEE5C5797EEA0C2713 to the temp directory. </maml:para></dev:remarks></command:example></command:examples></command:command><command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"><command:details><command:name>Backup-DbaDatabase</command:name><command:noun>DbaDatabase</command:noun><command:verb>Backup</command:verb><maml:description><maml:para>Backup one or more SQL Sever databases from a single SQL Server SqlInstance.</maml:para></maml:description></command:details><maml:description><maml:para>Performs a backup of a specified type of 1 or more databases on a single SQL Server Instance. These backups may be Full, Differential or Transaction log backups.</maml:para></maml:description><command:syntax><command:syntaxItem><maml:name>Backup-DbaDatabase</maml:name><command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false"><maml:name>SqlCredential</maml:name><maml:description><maml:para>Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).

Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.

0 comments on commit 400573d

Please sign in to comment.
You can’t perform that action at this time.