Skip to content

Fortigi/OmadaSqlTroubleshooter

Repository files navigation

Omada Sql Troubleshooter

PSGallery Version PSGallery Downloads PowerShell PSGallery Platform

DESCRIPTION

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.

OmadaSQLTroubleshooter Overview

Features:

  • 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);
  • Select you query or connection while typing in the related input field;
  • Filter queries while typing into the
  • Query history view:
    • Browse history;
    • Restore query from history;
    • Compare changes for each updated query;
    • Export historic queries to:
      • json;
      • csv;
      • txt.
  • Detailed logging to log window and console;
  • Authentication options:
    • Browser: Browser based on Selenium;
    • WebView2: Browser based on WebView2;
    • OAuth: OAuth2 based authentication (Only Entra ID is currently supported).
  • 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;
  • Option to store your credentials. When using Browser/WebView2 based authentication with Enter ID it is even able to enter your credentials automatically;
  • Keyboard shortcuts:
    • F5: Execute query;
    • Enter/Return after entering connection information: Initiate connection;
    • CTRL + S: Save current query in Omada.

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. Also make sure that you have the correct user permissions to Create, Read and Modify objects via OData.

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

INSTALLATION

To install the module from the PowerShell Gallery, you can use the following command:

Install-Module -Name OmadaSqlTroubleshooter

USAGE

Requirements

This module requires:

  • Windows operating system;
  • PowerShell 7;
  • OmadaWeb.PS PowerShell Module (Version 2025.12.2.1 or higher);
  • Microsoft Edge WebView2;
  • Omada Identity Cloud with OData enabled for the C_P_SQLTROUBLESHOOTING data object type;
  • Create, Read and Modify user permissions for OData.

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.
Webview2Runtime folder

Importing the Module

To import the module, use the following command:

Import-Module OmadaSqlTroubleshooter

SYNTAX

Invoke-OmadaSqlTroubleshooter

Invoke-OmadaSqlTroubleshooter [[-LogLevel] <string>] [-Reset] [-LogToConsole] [<CommonParameters>]

EXAMPLES

Here are some example commands you can use with the OmadaSqlTroubleshooter module:

Example 1: Start OmadaSqlTroubleshooter.

Invoke-OmadaSqlTroubleshooter

Example 2: Start OmadaSqlTroubleshooter with LogLevel Debug and log output to console

Invoke-OmadaSqlTroubleshooter -LogLevel DEBUG -LogToConsole

Example 3: Reset OmadaSqlTroubleshooter

Invoke-OmadaSqlTroubleshooter -Reset

PARAMETERS

-LogLevel

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

-LogToConsole

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

-UseWebView2Auth

Uses the WebView2 for browser-based authentication instead of Selenium.

Important

This parameter is deprecated, select the WebView2 authentication option from the UI instead.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NoReconnect

Prevents the application from attempting to reconnect to the Omada Identity Suite using the stored connection information.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Reset

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

-ProgressAction

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

None

NOTES

RELATED LINKS

OmadaWeb.PS

'Omada Documentation'

LICENSE

This project is licensed under the MIT License. See the LICENSE file for details.

About

A PowerShell module for managing and executing SQL queries in the Omada Identity Cloud SQL Troubleshooter.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors