Skip to main content

Prerequisites

Before you begin, ensure you have:
  • PSFalcon installed (Installation Guide)
  • CrowdStrike Falcon API credentials (Client ID and Client Secret)
  • PowerShell 5.1+ (Windows) or PowerShell 6+ (Linux/macOS)

Authentication

Authenticate to the CrowdStrike Falcon API using your OAuth2 credentials.

Basic Authentication

Connect to the default US-1 cloud:

Cloud-Specific Authentication

Connect to a specific CrowdStrike cloud region:

Multi-CID (MSSP) Authentication

For Falcon Flight Control environments, specify a member CID:
Your credentials and token are cached for automatic re-use. PSFalcon automatically refreshes your token when it’s about to expire (within 240 seconds).

Verify Authentication

Check your authentication status:
Example output:
Use Show-FalconToken to display your current access token value, or Revoke-FalconToken to revoke your token and clear cached credentials.

Your First Query

Now that you’re authenticated, let’s retrieve information about hosts in your environment.

List Host IDs

Get a list of host identifiers:
This returns an array of host IDs (AIDs):

Get Host Details

Retrieve detailed information about specific hosts:

Search with Filters

Use Falcon Query Language (FQL) to filter results:

Retrieve All Results

By default, API requests return up to 100 results. Use -All to retrieve everything:

Common Operations

Working with Detections

Retrieve and manage detections:

Managing Host Groups

Real-time Response

Start an RTR session and execute commands:

Policy Management

Best Practices

1

Secure Credential Storage

Never hardcode credentials in scripts. Use secure methods:
2

Use Filters Wisely

Filter on the server side to reduce data transfer and improve performance:
3

Handle Rate Limits

PSFalcon automatically handles rate limits, but for bulk operations, add delays:
4

Error Handling

Implement proper error handling:

Complete Example Script

Here’s a complete script that demonstrates common PSFalcon operations:
Replace 'your_client_id' and 'your_client_secret' with your actual API credentials before running the script.

Exploring Available Cmdlets

Discover all PSFalcon cmdlets:

Next Steps

API Reference

Explore all available cmdlets and parameters

Example Scripts

Browse real-world automation examples

FQL Guide

Learn Falcon Query Language for advanced filtering

Real-time Response

Master RTR automation with PSFalcon

Getting Help

Need help? Check the PSFalcon Wiki for comprehensive documentation, or use PowerShell’s built-in help system with Get-Help <cmdlet-name> -Full.