Get-GitHubSecretScanningAlertsForOrg

SYNOPSIS

List secret scanning alerts for an organization

SYNTAX

__AllParameterSets

Get-GitHubSecretScanningAlertsForOrg [-Org] <string> [-State <string>] [-SecretType <string>]
 [-ExcludeSecretTypes <string>] [-ExcludeProviders <string>] [-Providers <string>]
 [-Resolution <string>] [-Assignee <string>] [-Sort <string>] [-Direction <string>] [-Page <long>]
 [-PerPage <long>] [-Before <string>] [-After <string>] [-Validity <string>] [-IsPubliclyLeaked]
 [-IsMultiRepo] [-HideSecret] [-IsBypassed] [-IncludedMetadata <string>] [-OwnerEmailHash <string>]
 [-AllResults] [-Accept <string>]

ALIASES

This cmdlet has the following aliases,

  • Get-GHSecretScanningAlertsForOrg

DESCRIPTION

The Get-GitHubSecretScanningAlertsForOrg cmdlet invokes the GET method of the /orgs/{org}/secret-scanning/alerts endpoint (List secret scanning alerts for an organization)

Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the ‘repo’ or ‘security_events’ scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the ‘public_repo’ scope instead.

Endpoint: GET /orgs/{org}/secret-scanning/alerts API version: 2026-03-10

EXAMPLES

EXAMPLE 1

Get-GitHubSecretScanningAlertsForOrg -Org 'github'

Invokes GET /orgs/{org}/secret-scanning/alerts

EXAMPLE 2

Get-GitHubSecretScanningAlertsForOrg -Org 'github' -AllResults

Returns the items of every page

PARAMETERS

-Accept

The Accept header (media type) of the request Default value: application/vnd.github+json

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-After

A cursor, as given in the Link header (https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty “after” query string.

Query parameter [ after ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AllResults

Follows the pagination links & returns the items of every page. 100 items are requested per page unless the per page parameter is used

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Assignee

Filters alerts by assignee. Use ‘*’ to get all assigned alerts, ‘none’ to get all unassigned alerts, or a GitHub username to get alerts assigned to a specific user.

Query parameter [ assignee ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Before

A cursor, as given in the Link header (https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty “before” query string.

Query parameter [ before ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Direction

The direction to sort the results by.

Query parameter [ direction ]

Default value: desc

Allowed values: ‘asc’, ‘desc’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ExcludeProviders

A comma-separated list of provider slugs to exclude from the results. Provider slugs use lowercase with underscores (e.g., ‘github_secret_scanning’, ‘clojars’). You can find the provider slug in the ‘provider_slug’ field of each alert. Cannot be combined with the ‘providers’ parameter.

Query parameter [ exclude_providers ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ExcludeSecretTypes

A comma-separated list of secret types to exclude from the results. All default secret patterns are returned except those matching the specified types. Cannot be combined with the ‘secret_type’ parameter. See “Supported secret scanning patterns (https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)” for a complete list of secret types.

Query parameter [ exclude_secret_types ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-HideSecret

A boolean value representing whether or not to hide literal secrets in the results.

Query parameter [ hide_secret ]

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IncludedMetadata

A comma-separated list of metadata fields to filter alerts by. Only alerts that have all of the specified metadata fields attached will be returned. Possible values are: ‘owner-email’, ‘owner-id’, ‘owner-name’, ‘secret-id’, ‘secret-name’, ‘secret-issued-date’, ‘secret-expiration-date’, ‘organization-name’, ‘organization-id’, ‘last-used-date’, and ‘has-organization-access’.

Query parameter [ included_metadata ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IsBypassed

A boolean value (‘true’ or ‘false’) indicating whether to filter alerts by their push protection bypass status. When set to ‘true’, only alerts that were created because a push protection rule was bypassed will be returned. When set to ‘false’, only alerts that were not caused by a push protection bypass will be returned.

Query parameter [ is_bypassed ]

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IsMultiRepo

A boolean value representing whether or not to filter alerts by the multi-repo tag being present.

Query parameter [ is_multi_repo ]

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IsPubliclyLeaked

A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present.

Query parameter [ is_publicly_leaked ]

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Org

The organization name. The name is not case sensitive.

Path parameter [ org ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-OwnerEmailHash

Filters alerts to only those whose attached ‘owner_email’ metadata field matches the provided value. The value must be the lowercase hex-encoded SHA-256 hash of the email address to match (for example, the SHA-256 of ‘user@example.com’). Only alerts that have an ‘owner_email’ metadata value whose SHA-256 hash equals this parameter are returned.

Query parameter [ owner_email_hash ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Page

The page number of the results to fetch. For more information, see “Using pagination in the REST API (https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).”

Query parameter [ page ]

Default value: 1

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PerPage

The number of results per page (max 100). For more information, see “Using pagination in the REST API (https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).”

Query parameter [ per_page ]

Default value: 30

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Providers

A comma-separated list of provider slugs to filter by. Provider slugs use lowercase with underscores (e.g., ‘github_secret_scanning’, ‘clojars’). You can find the provider slug in the ‘provider_slug’ field of each alert. Cannot be combined with the ‘exclude_providers’ parameter.

Query parameter [ providers ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Resolution

A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are ‘false_positive’, ‘wont_fix’, ‘revoked’, ‘pattern_edited’, ‘pattern_deleted’ or ‘used_in_tests’.

Query parameter [ resolution ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecretType

A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. See “Supported secret scanning patterns (https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)” for a complete list of secret types.

Query parameter [ secret_type ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Sort

The property to sort the results by. ‘created’ means when the alert was created. ‘updated’ means when the alert was updated or resolved.

Query parameter [ sort ]

Default value: created

Allowed values: ‘created’, ‘updated’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-State

Set to ‘open’ or ‘resolved’ to only list secret scanning alerts in a specific state.

Query parameter [ state ]

Allowed values: ‘open’, ‘resolved’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Validity

A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are ‘active’, ‘inactive’, and ‘unknown’.

Query parameter [ validity ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

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

INPUTS

Objects with properties named like the path parameters can be piped to this function

{{ Fill in the Description }}

System.String

{{ Fill in the Description }}

OUTPUTS

The response of the GitHub API (objects

{{ Fill in the Description }}

NOTES

OperationId: secret-scanning/list-alerts-for-org Category: secret-scanning / secret-scanning