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: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: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: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