Table: workos_directory - Query WorkOS Directories using SQL
WorkOS Directories is a feature within WorkOS that enables you to manage and sync your organization's directory data. It provides a centralized way to handle directory services, including users, groups, and more. WorkOS Directories assists you in maintaining an updated and organized view of your directory structure across various platforms.
Table Usage Guide
The workos_directory
table provides insights into directories within WorkOS. As an IT administrator, explore directory-specific details through this table, including directory ID, name, type, and state. Utilize it to uncover information about directories, such as those that are active or inactive, the type of directory (e.g., Google Workspace, Azure AD), and the verification of directory names.
Examples
Basic info
Explore which directories are active within your organization, when they were created, and their associated domain details. This can be beneficial for understanding the structure and timeline of your organizational directories.
select id, name, state, organization_id, created_at, domainfrom workos_directory;
select id, name, state, organization_id, created_at, domainfrom workos_directory;
List directories of a particular organization
Determine the areas in which specific organizational directories are located and when they were created. This is particularly useful for tracking and managing directories within a certain organization.
select d.id as directory_id, d.name as directory_name, d.state, d.organization_id, d.created_at, d.domainfrom workos_directory as d, workos_organization as owhere d.organization_id = o.id and o.name = 'test';
select d.id as directory_id, d.name as directory_name, d.state, d.organization_id, d.created_at, d.domainfrom workos_directory as d, workos_organization as owhere d.organization_id = o.id and o.name = 'test';
List unlinked directories
Discover the segments that contain unlinked directories to maintain data integrity and ensure all directories are properly connected. This is beneficial in identifying potential issues that could affect data accessibility and organization.
select id, name, state, organization_id, created_at, domainfrom workos_directorywhere state = 'unlinked';
select id, name, state, organization_id, created_at, domainfrom workos_directorywhere state = 'unlinked';
List gsuite directories
Explore the Gsuite directories in your organization to understand their current state and creation date. This can be useful for auditing purposes or to manage the directories more effectively.
select id, name, state, organization_id, created_at, domainfrom workos_directorywhere type = 'gsuite directory';
select id, name, state, organization_id, created_at, domainfrom workos_directorywhere type = 'gsuite directory';
List directories created in the last 30 days
Explore recent organizational changes by identifying directories that were established within the last month. This allows for a timely review and management of new additions to the system.
select id, name, state, organization_id, created_at, domainfrom workos_directorywhere created_at >= now() - interval '30' day;
select id, name, state, organization_id, created_at, domainfrom workos_directorywhere created_at >= datetime('now', '-30 day');
Schema for workos_directory
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
created_at | timestamp with time zone | The timestamp of when the directory was created. | |
domain | text | = | Directory domain. |
external_key | text | Externally used identifier for the directory. | |
id | text | = | Directory unique identifier. |
idp_id | text | The user's directory provider's identifier. | |
name | text | = | Directory name. |
organization_id | text | = | Identifier for the directory's organization. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | Linked status for the directory. | |
title | text | Title of the resource. | |
type | text | Type of the directory. | |
updated_at | timestamp with time zone | The timestamp of when the directory was updated. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- workos
You can pass the configuration to the command with the --config
argument:
steampipe_export_workos --config '<your_config>' workos_directory