Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Export-DbaRegServer on GitHub.
Want to see the Bill Of Health for this command? Check out Export-DbaRegServer.
Exports registered servers and registered server groups to file
Exports registered servers and registered server groups to file
Export-DbaRegServer
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-SqlCredential] <PSCredential>]
[[-InputObject] <Object[]>]
[[-Path] <String>]
[[-FilePath] <FileInfo>]
[[-CredentialPersistenceType] <String>]
[[-Group] <Object[]>]
[[-ExcludeGroup] <Object[]>]
[-Overwrite]
[-EnableException]
[<CommonParameters>]
PS C:\> Export-DbaRegServer -SqlInstance sql2008
Exports all Registered Server and Registered Server Groups on sql2008 to an automatically generated file name in the current directory
PS C:\> Get-DbaRegServer -SqlInstance sql2008, sql2012 | Export-DbaRegServer
Exports all registered servers on sql2008 and sql2012. Warning - each one will have its own individual file. Consider piping groups.
PS C:\> Get-DbaRegServerGroup -SqlInstance sql2008, sql2012 | Export-DbaRegServer
Exports all registered servers on sql2008 and sql2012, organized by group.
The target SQL Server instance or instances.
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 |
Enables piping from Get-DbaRegServer, Get-DbaRegServerGroup, CSVs and other objects.
If importing from CSV or other object, a column named ServerName is required. Optional columns include Name, Description and Group.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
Specifies the directory where the file or files will be exported.
Alias | |
Required | False |
Pipeline | false |
Default Value | (Get-DbatoolsConfigValue -FullName 'Path.DbatoolsExport') |
Specifies the full file path of the output file. The file must end with .xml or .regsrvr
Alias | OutFile,FileName |
Required | False |
Pipeline | false |
Default Value |
Used to specify how the login and passwords are persisted. Valid values include None, PersistLoginName and PersistLoginNameAndPassword.
Alias | |
Required | False |
Pipeline | false |
Default Value | None |
Accepted Values | None,PersistLoginName,PersistLoginNameAndPassword |
Specifies one or more groups to include.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Specifies one or more groups to exclude.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Specifies to overwrite the output file (FilePath) if it already exists.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
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 |