> ## Documentation Index
> Fetch the complete documentation index at: https://ps365.clidsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get-MgApplicationExpiringCertAndKey

## SYNOPSIS

Retrieves Entra ID applications with expiring credentials or SAML certificates.

## SYNTAX

```powershell theme={null}
Get-MgApplicationExpiringCertAndKey [[-DaysUntilExpiry] <int>] [[-ExportPath] <string>]
 [-ForceNewToken] [-ExportToExcel] [-UseBatchRequest]
```

## DESCRIPTION

This function identifies all Entra ID applications that have credentials (keys/passwords) or SAML signing certificates
that will expire within a specified number of days.
It combines data from both regular application credentials
and SAML-specific certificates to provide a comprehensive view of expiring security components.

## EXAMPLES

### EXAMPLE 1

```powershell theme={null}
Get-MgApplicationExpiringCertAndKey
```

Retrieves all applications with credentials or SAML certificates expiring within the next 30 days.

### EXAMPLE 2

```powershell theme={null}
Get-MgApplicationExpiringCertAndKey -UseBatchRequest
```

Retrieves the expiring credentials using the Graph JSON \$batch endpoint for the underlying functions.

### EXAMPLE 3

```powershell theme={null}
Get-MgApplicationExpiringCertAndKey -DaysUntilExpiry 7
```

Retrieves all applications with credentials or SAML certificates expiring within the next 7 days.

### EXAMPLE 4

```powershell theme={null}
Get-MgApplicationExpiringCertAndKey -DaysUntilExpiry 60 -ExportToExcel
```

Gets all applications with credentials expiring within 60 days and exports to Excel.

## PARAMETERS

### -DaysUntilExpiry

The number of days to check for expiring credentials.
Applications with credentials expiring within this timeframe will be returned.
Default is 30 days.

```yaml theme={null}
Type: System.Int32
DefaultValue: 30
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -ExportPath

Optional output directory for the Excel export (defaults to the user profile).

```yaml theme={null}
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -ExportToExcel

Exports the results to an Excel file.

```yaml theme={null}
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: ''
```

### -ForceNewToken

\{\{ Fill ForceNewToken Description }}

```yaml theme={null}
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: ''
```

### -UseBatchRequest

(Optional) Passed through to Get-MgApplicationCredential and Get-MgApplicationSAML: uses the Microsoft Graph
JSON \$batch endpoint (20 requests per HTTP call with automatic HTTP 429 retry) instead of ForEach-Object -Parallel.

```yaml theme={null}
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: ''
```

### 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](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

This function requires both Get-MgApplicationCredential and Get-MgApplicationSAML functions to be available.

Author: Bastien Perez

## RELATED LINKS

* [https://ps365.clidsys.com/docs/commands/Get-MgApplicationExpiringCertAndKey](https://ps365.clidsys.com/docs/commands/Get-MgApplicationExpiringCertAndKey)
