Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Export-DbaCredential on GitHub.
Want to see the Bill Of Health for this command? Check out Export-DbaCredential.
Exports credentials INCLUDING PASSWORDS, unless specified otherwise, to sql file.
Exports credentials INCLUDING PASSWORDS, unless specified otherwise, to sql file.
Requires remote Windows access if exporting the password.
Export-DbaCredential
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-Identity] <String[]>]
[[-SqlCredential] <PSCredential>]
[[-Credential] <PSCredential>]
[[-Path] <String>]
[[-FilePath] <String>]
[-ExcludePassword]
[-Append]
[[-InputObject] <Credential[]>]
[-EnableException]
[<CommonParameters>]
PS C:\> Export-DbaCredential -SqlInstance sql2017 -Path C:\temp\cred.sql
Exports credentials, including passwords, from sql2017 to the file C:\temp\cred.sql
The target SQL Server instance or instances.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The credentials to export. If unspecified, all credentials will be exported.
Alias | |
Required | False |
Pipeline | false |
Default Value |
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.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Login to the target OS using alternative credentials. Accepts credential objects (Get-Credential)
Alias | |
Required | False |
Pipeline | false |
Default Value |
The path to the directory that will contain the exported sql file.
Alias | |
Required | False |
Pipeline | false |
Default Value | (Get-DbatoolsConfigValue -FullName 'Path.DbatoolsExport') |
The specific path to a file which will contain the output.
Alias | OutFile,FileName |
Required | False |
Pipeline | false |
Default Value |
Exports the SQL credential without any sensitive information.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Append to Path
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Allow credentials to be piped in from Get-DbaCredential
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
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.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |