Set-TRConnection
Synopsis
Used to override the database connection that is embedded inside a report file.
Syntax
Set-TRConnection [-Username] <String> [-Password] <String> [<CommonParameters>] Set-TRConnection [[-Username] <String>] [[-Password] <String>] [[-Database] <String>] [[-Server] <String>] [[-Ssl] <SwitchParameter>] [<CommonParameters>] Set-TRConnection [-Database] <String> [-Server] <String> [[-Ssl] <SwitchParameter>] [<CommonParameters>]
Description
Database connection settings are set inside the report file. The report file defines the data source that it uses. For The Report Processor to work, that data source must exist on the system.
Sometimes it is useful to override the data source that is embedded inside the report file. This extra work may cause the reporting process to run slower.
This command has three different forms. One overrides just the username and password. One overrides just the server and database. The third requires override values for username, password, server, and database.
All database connections inside the report will be overridden to the same connection.
It takes time to override database connections. It&;39;s better to use the connections embedded inside the report.
If you are using x86 version of The Report Processor, then make sure to use x86 or thirty-two bit (32-bit) database drivers, PowerShell, etc. If using x86-64 then use sixty-four bit (64-bit) database drivers, etc.
See the examples for common use.
Parameters
-Username <String>
Required? | True |
Position? | 0 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-Password <String>
Required? | True |
Position? | 1 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-Database <String>
Required? | False |
Position? | 2 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-Server <String>
Required? | False |
Position? | 3 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-Ssl <SwitchParameter>
Required? | False |
Position? | 4 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
Inputs
Outputs
Notes
Examples
Example Swizzle Credentials
PS C:\> Set-Connection -Username "Your-Username" -Password "Your-Password"
A ConnectionInfo object that should be passed to the Invoke-TRProcessor method.
Do this if the data source requires credentials, and they are not stored with your database driver or other file.
Best is to override credentials when creating your database driver. Some databases may be configured to prevent that method, requiring a login with each access. In that case, use this method to override your database connection settings.
Example Swizzle Data Source
PS C:\> Set-Connection -Database "Override-DB" -Server "Override-Server"
A ConnectionInfo object that should be passed to the Invoke-Report method.
Use this command if you would like to use a data source other than the one that is embedded inside the report file.
Example Swizzle ODBC
PS C:\> Set-Connection -Database "ODBC Data Source Name (DSN)" -Server "ODBC Data Source Name (DSN)"
A ConnectionInfo object that should be passed to the Invoke-Report method.
Better to just create an ODBC driver with the same Data Source Name (DSN) as the one that is embedded inside the report file.
You can also pass username and password options when overriding ODBC, but it&;39;s also better to do this in the ODBC editor.