OmadaSqlTroubleshooter is a PowerShell Module that contains an interactive desktop application that is used to manage and execute SQL queries stored in the SQL Troubleshooting section in Omada Identity Suite.
- Create, update and execute SQL Queries;
- View output in a PowerShell GridView;
- Export output to:
- json;
- csv;
- PowerShell CliXml;
- Text.
- Save queries without executing;
- Basic IntelliSense for Sql, tables and columns;
- Schema view with the ability to enter the selected item in the editor (SHIFT + Select Table/Column).
- Detailed logging to log window and console;
- Authentication options:
- Browser based;
- OAuth.
- Auto complete connection url. Eg. Tenant name completes to https://tenantname.omada.cloud.
- Automatic storing of the current application state, e.g. current connection, current query, application layout, etc.
This application leverages the permissions of the user that is logged in. The application uses the built-in OData endpoint (C_P_SQLTROUBLESHOOTING) for the SQL Troubleshooter and the Omada Enterprise Server API.
Important
The C_P_SQLTROUBLESHOOTING OData endpoint is disabled by default. Enabled it in the Data Object Type configuration in Omada in order to use this application.
Important
Authentication is handled by the OmadaWeb.PS PowerShell module. This module must be installed before running the application. OmadaWeb.PS can simply be installed using this command:
Install-Module -Name OmadaWeb.PS
To install the module from the PowerShell Gallery, you can use the following command:
Install-Module -Name OmadaSqlTroubleshooter
This module requires:
- Windows operating system;
- PowerShell 7;
- OmadaWeb.PS PowerShell Module;
- Microsoft Edge WebView2;
- Omada Identity Cloud with OData enabled for the C_P_SQLTROUBLESHOOTING data object type.
Note
If you are not able to install Microsoft Edge Webview2 you can download the Fixed Version x64 bit from here. Extract the Cab file using e.g. 7-Zip, copy the contents from folder 'Microsoft.WebView2.FixedVersionRuntime.xxxx.x64'
to %LOCALAPPDATA%\OmadaSqlTroubleshooter\bin\Webview2Runtime
. The contents of the target folder should now like as shown in the image below.
To import the module, use the following command:
Import-Module OmadaSqlTroubleshooter
Invoke-OmadaSqlTroubleshooter [[-LogLevel] <string>] [-Reset] [-LogToConsole] [<CommonParameters>]
Here are some example commands you can use with the OmadaSqlTroubleshooter module:
Invoke-OmadaSqlTroubleshooter
Invoke-OmadaSqlTroubleshooter -LogLevel DEBUG -LogToConsole
Invoke-OmadaSqlTroubleshooter -Reset
Set the loglevel. Default is INFO
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: INFO, DEBUG, VERBOSE, WARNING, ERROR, FATAL, VERBOSE2
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Outputs logging to the console.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Resets the stored configuration to default.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This project is licensed under the MIT License. See the LICENSE file for details.